;; random walk in 3D ;; Niles Johnson ;; ;; line color & thickness indicate ;; ~*the third dimension*~ ;; make "currcolor 128 make "greenval 192 make "i 0 repeat 5000 [ ;fd 2+:i/200 ;; use this to produce spiral (to see color-axis) ;rt 7-:i/2000 ;; use this to produce spiral (to see color-axis) fd 7 ;; comment this out to see color-axis rt 4*(rand 90) ;; comment this out to see color-axis make "colorstep rand 5 make "pm rand 2 ;make "pm 1 ;; use this to produce spiral (to see color-axis) ifelse :pm >0 [make "currcolor :currcolor+4*:colorstep] [make "currcolor :currcolor-4*:colorstep] if :currcolor > 255 [make "greenval :greenval + 128] if :currcolor < 0 [make "greenval :greenval - 128] ;print "oo ;print :currcolor ;print :greenval make "currcolor mod :currcolor+256 256 :make "currpen mod :currpen 2 make "greenval mod :greenval+256 256 ;print :currcolor ;print :greenval make "currpen :greenval/192 + 1.5 color [255-:currcolor :greenval :currcolor] penwidth :currpen ;print :currcolor ;print :greenval make "i :i+10 ]