Make an interactive scribble, with a seed to determine the random choices. Drag the sliders to get different scribbles:
This makes a random scribble with 30 points:
Graphics[{AbsoluteThickness[5], BezierCurve[RandomReal[1, {30, 2}]]}]
You can make an interactive interface to control the number of points in the scribble using Manipulate.
Wrap the scribble expression with Manipulate[...], replace 30 with the variable length, and specify that length varies from 10 to 200 in steps of 1. Drag the slider to get random scribbles of various lengths:
Manipulate[
Graphics[{AbsoluteThickness[5],
BezierCurve[RandomReal[1, {length, 2}]]}],
{length, 10, 200, 1}
]
The scribble jumps around as you drag the slider because RandomReal gives different coordinate positions each time.
If you add SeedRandom[12345] to the code, the scribble stays the same as you drag the slider, but gets longer and shorter. That’s because SeedRandom resets the random number generator to the same point each time the scribble is drawn, so that you get the same sequence of random numbers:
Manipulate[
SeedRandom[12345];
Graphics[{AbsoluteThickness[5],
BezierCurve[RandomReal[1, {length, 2}]]}],
{length, 10, 200, 1}
]
You can give SeedRandom a different number—54321 instead of 12345—to reset the random number generator to a different point, and get a different scribble:
Manipulate[
SeedRandom[54321];
Graphics[{AbsoluteThickness[5],
BezierCurve[RandomReal[1, {length, 2}]]}],
{length, 10, 200, 1}
]
You might as well make the seed interactive too, so that you have a control that chooses the scribble:
Manipulate[
SeedRandom[seed];
Graphics[{AbsoluteThickness[5],
BezierCurve[RandomReal[1, {length, 2}]]}],
{length, 10, 200, 1},
{seed, 12345, 67890, 1}
]
Manipulate[
SeedRandom[seed];
Graphics[{AbsoluteThickness[5],
BezierCurve[RandomReal[1, {length, 2}]]}],
{length, 10, 200, 1},
{seed, 12345, 67890, 1}
]