MRRAP[m_,n_,s_]:=Module[{lr,ri,ap},
lr=(#[[1]]->{RandomChoice[{-1,1}] #[[2]]})&/@Partition[RandomInteger[{1,9},m],2];
ri=RandomInteger[{1,n},4];
ap=AnglePath[Flatten[SubstitutionSystem[lr,ri,256]]];
Graphics[Table[{Hue[i/Length[ap]],Line[{ap[[i]],ap[[i+1]]}]},
{i,16,Length[ap]-1,1}],ImageSize->s]];
{MRRAP[32,16,300],MRRAP[16,12,300]}
MRRAP[64,16,600]
No comments:
Post a Comment