I don't know if turtle graphics qualify as doodles, but here are some ideas. This turtle code is based on a reference that I can no longer find. Sorry.
RandomTurtle[recursion_List, axiom_String, depth_Integer, angle_,
steplen_, posn_List : {0., 0.},
dir_List : {1., 0.}, maxpts_Integer : 10,
maxpaths_Integer : 1] :=
Module[{
symbols, replacerules, turtle, tpos, tdir,
stack = {{N[posn], N[dir]}},
path = Table[Null, {maxpaths}, {maxpts}], pathnum = 0,
npts = Table[1, {maxpaths}],
rotateleft, rotateright, c = N[Cos[angle Degree]],
s = N[Sin[angle Degree]], k},
symbols = {"F" -> forward, "B" -> back, "-" -> right,
"+" -> left, "i" -> flip, "[" -> push, "]" -> pop};
replacerules[r_List] :=
Map[Characters[#[[1]]][[1]] -> Characters[#[[2]]] &, r] /. symbols;
turtle[pop] := ({tpos, tdir} = First[stack];
path[[++pathnum, 1]] = tpos;
stack = Rest[stack]);
turtle[push] := PrependTo[stack, {tpos, tdir}];
turtle[left] := tdir = rotateleft . tdir;
turtle[right] := tdir = rotateright . tdir;
turtle[forward] :=
path[[pathnum, ++npts[[pathnum]]]] = (tpos += steplen tdir);
turtle[back] :=
path[[pathnum, ++npts[[pathnum]]]] = (tpos -= steplen tdir);
turtle[flip] := {rotateleft, rotateright} = {rotateright, rotateleft};
Attributes[turtle] = Listable;
rotateright = Transpose[rotateleft = {{c, -s}, {s, c}}];
k = 0;
turtle[Nest[
(k = k + 1; # /. replacerules[{recursion[[k]]}]) &,
Prepend[Characters[axiom] /. symbols, pop], depth]];
path = Map[Take[path[[#]], npts[[#]]] &, Range[pathnum]]
]
Generate m
random rules for the turtle.
RandomRuleGen[m_Integer] :=
Map[
"F" -> StringJoin[#] &,
RandomChoice[{"F", "B", "-", "+", "i"}, {m, 20}] //.
{{x___, "F", "B", z___} -> {x, z}, {x___, "B", "F", z___} -> {x, z},
{x___, "+", "-", z___} -> {x, z}, {x___, "-", "+", z___} -> {x, z},
{x___, "i", "i", z___} -> {x, z}}]
The following plots random graphics.
RandomTurtleGallery[m_Integer, n_Integer, order_] :=
Block[{r = RandomRuleGen[m], RuleTuples, paths},
RuleTuples = Tuples[r, {n}];
Print[r];
paths = Table[
RandomTurtle[
RuleTuples[[i]],
StringJoin[Riffle[ConstantArray["F", order], "-"]], n, 360./order,
1.0, {0., 0.}, {1., 0.}, 2^(3 n + 3) + 1, 1],
{i, 1, Length[RuleTuples]}];
GraphicsGrid[Partition[Map[Graphics[Line[#]] &, paths], UpTo[6]]]
]
Here are some examples with 7-fold symmetry.
RandomTurtleGallery[3, 4, 7]
{F->-B++BiB-Fi,F->Fi--B-i----i,F->Bi-FFFi++i}
Graphics[Line[AnglePath[N@Range[300000]]]]
:-) $\endgroup$Line
+BSplineFunction
/BezierFunction
to get some flexibility in styling. For example,SeedRandom[7]; Graphics[{AbsoluteThickness[20], CapForm["Round"], JoinForm["Round"], Line[BSplineFunction[RandomReal[1, {20, 2}]] /@ Subdivide[300], VertexColors -> (Append[ColorData["Rainbow"]@#, .9] & /@ Subdivide[300])]}, ImageSize -> 500]
$\endgroup$