Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /getcolor { % ever seen anything as ugly?
- dup 8 mod 0 eq
- {0 0 0}
- {dup 8 mod 1 eq
- {0 0 1}
- {dup 8 mod 2 eq
- {0 1 0}
- {dup 8 mod 3 eq
- {0 1 1}
- {dup 8 mod 4 eq
- {1 0 0}
- {dup 8 mod 5 eq
- {1 0 1}
- {dup 8 mod 6 eq
- {1 1 0}
- {0.9 0.9 0.9} ifelse} ifelse} ifelse} ifelse} ifelse} ifelse} ifelse
- } def
- /getcoordinates {
- 10
- } def
- /draw {
- newpath
- 300 500 moveto
- dup % duplicate the top of the stack -- we need to use the number in both getcolor and getcoordinates
- getcolor setrgbcolor
- getcoordinates rlineto
- stroke
- } def
- 0 1 100 {draw} for
Add Comment
Please, Sign In to add comment