Created
April 4, 2014 14:16
-
-
Save mdlawson/9975550 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| %!PS-Adobe-3.0 | |
| /Xpos { 300 } def | |
| /Ypos { 500 } def | |
| /Heading { 0 } def | |
| /Arg { 0 } def | |
| /Right { | |
| Heading exch add Trueheading | |
| /Heading exch def | |
| } def | |
| /Left { | |
| Heading exch sub Trueheading | |
| /Heading exch def | |
| } def | |
| /Trueheading { | |
| 360 mod dup | |
| 0 lt { 360 add } if | |
| } def | |
| /Forward { | |
| dup Heading sin mul | |
| exch Heading cos mul | |
| 2 copy Newposition | |
| rlineto | |
| } def | |
| /Newposition { | |
| Heading 180 gt Heading 360 lt | |
| and { neg } if exch | |
| Heading 90 gt Heading 270 lt | |
| and { neg } if exch | |
| Ypos add /Ypos exch def | |
| Xpos add /Xpos exch def | |
| } def | |
| /LHILBERT { | |
| Arg | |
| 0 | |
| ne | |
| { | |
| 90 | |
| Left | |
| Arg | |
| Arg | |
| 1 | |
| sub | |
| /Arg exch def | |
| RHILBERT | |
| /Arg exch def | |
| 4 | |
| Forward | |
| 90 | |
| Right | |
| Arg | |
| Arg | |
| 1 | |
| sub | |
| /Arg exch def | |
| LHILBERT | |
| /Arg exch def | |
| 4 | |
| Forward | |
| Arg | |
| Arg | |
| 1 | |
| sub | |
| /Arg exch def | |
| LHILBERT | |
| /Arg exch def | |
| 90 | |
| Right | |
| 4 | |
| Forward | |
| Arg | |
| Arg | |
| 1 | |
| sub | |
| /Arg exch def | |
| RHILBERT | |
| /Arg exch def | |
| 90 | |
| Left | |
| } { | |
| 0 | |
| Forward | |
| } ifelse | |
| } def | |
| /RHILBERT { | |
| Arg | |
| 0 | |
| ne | |
| { | |
| 90 | |
| Right | |
| Arg | |
| Arg | |
| 1 | |
| sub | |
| /Arg exch def | |
| LHILBERT | |
| /Arg exch def | |
| 4 | |
| Forward | |
| 90 | |
| Left | |
| Arg | |
| Arg | |
| 1 | |
| sub | |
| /Arg exch def | |
| RHILBERT | |
| /Arg exch def | |
| 4 | |
| Forward | |
| Arg | |
| Arg | |
| 1 | |
| sub | |
| /Arg exch def | |
| RHILBERT | |
| /Arg exch def | |
| 90 | |
| Left | |
| 4 | |
| Forward | |
| Arg | |
| Arg | |
| 1 | |
| sub | |
| /Arg exch def | |
| LHILBERT | |
| /Arg exch def | |
| 90 | |
| Right | |
| } { | |
| 0 | |
| Forward | |
| } ifelse | |
| } def | |
| /MAIN { | |
| Arg | |
| 6 | |
| /Arg exch def | |
| LHILBERT | |
| /Arg exch def | |
| } def | |
| Xpos Ypos moveto | |
| MAIN | |
| stroke | |
| showpage |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment