Guest User

Untitled

a guest
May 20th, 2018
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. /getcolor { % ever seen anything as ugly?
  2. dup 8 mod 0 eq
  3. {0 0 0}
  4. {dup 8 mod 1 eq
  5. {0 0 1}
  6. {dup 8 mod 2 eq
  7. {0 1 0}
  8. {dup 8 mod 3 eq
  9. {0 1 1}
  10. {dup 8 mod 4 eq
  11. {1 0 0}
  12. {dup 8 mod 5 eq
  13. {1 0 1}
  14. {dup 8 mod 6 eq
  15. {1 1 0}
  16. {0.9 0.9 0.9} ifelse} ifelse} ifelse} ifelse} ifelse} ifelse} ifelse
  17. } def
  18.  
  19. /getcoordinates {
  20. 10
  21. } def
  22.  
  23. /draw {
  24. newpath
  25. 300 500 moveto
  26. dup % duplicate the top of the stack -- we need to use the number in both getcolor and getcoordinates
  27. getcolor setrgbcolor
  28. getcoordinates rlineto
  29. stroke
  30. } def
  31.  
  32.  
  33. 0 1 100 {draw} for
Add Comment
Please, Sign In to add comment