Created
June 22, 2018 20:46
-
-
Save ruda/788e6cbf2ba3cae6d2f0b4d0e93596d2 to your computer and use it in GitHub Desktop.
Geometric figures resembling flowers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%! | |
/inch {72 mul} def | |
/cm {2.54 div 72 mul cvi} def | |
/maxint {2 32 exp 1 sub} def | |
/urand {rand maxint div} def | |
/forward {0 exch rlineto} def | |
/right {neg rotate} def | |
/left {rotate} def | |
/center {4 inch 5 inch moveto} def | |
/square {4 {dup forward 90 right} repeat pop} def | |
/flower {36 {10 right dup square} repeat pop} def | |
/setrandomposition {rand 8 inch mod rand 10 inch mod moveto} def | |
/setrandomcolor {urand urand urand setrgbcolor} def | |
/garden {{newpath setrandomposition setrandomcolor rand 3 cm mod flower stroke} repeat} def | |
25 garden | |
showpage |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment