home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 3 / PDCD_3.iso / utilities / utilsm / mkdrawf / Examples / src / Random < prev    next >
Encoding:
Text File  |  1995-04-30  |  815 b   |  37 lines

  1. # Five random walks. If you ever learned about Brownian motion
  2. # at school, you'll have seen things like this before.
  3.  
  4. For $z 0 5 {
  5.   Path {
  6.     OutlineColour Floor Times Random 256
  7.                   Floor Times Random 256
  8.                   Floor Times Random 256
  9.     Move 500 500
  10.     For $q 0 2000 {
  11.       RLine Minus Times Random 20 10 Minus Times Random 20 10
  12.     }
  13.   }
  14. }
  15.  
  16. # A "chessboard" whose squares are random colours.
  17.  
  18. Group {
  19.   For $x 0 8 {
  20.     Set $xx Plus 100 Times $x 30
  21.     For $y 0 8 {
  22.       Set $yy Plus 100 Times $y 30
  23.       Path {
  24.         OutlineColour None
  25.         FillColour Floor Times Random 256
  26.                    Floor Times Random 256
  27.                    Floor Times Random 256
  28.         Move $xx $yy
  29.         RLine 30 0
  30.         RLine 0 30
  31.         RLine -30 0
  32.         Close
  33.       }
  34.     }
  35.   }
  36. }
  37.