 
Scribbly in simulations are created according to several mathematical formulas (selection at the bottom). The formulas only works in the scribbly  body part
(where there are "regular" zigzags), and the remaining parts are created as follows:
 
The selection of formulas for simulation is described in the article (
here), and their use in the program is based on a loops 
that calculates the subsequent movements of the larva creating the scribbly (more information after selecting a given formula).
Remember! This is a simulation, i.e. a "simplified version of reality", and a large number of variables 
with random values
 means  that unexpected "graphic miracles" can happen.
Select a formula to simulate (you will also find additional explanations there)