;;; spirals.nlogo, cr 21 jan 2008 by nada ;;; Three buttons; setup, step, go with arrows showing continuous ;;; Program by Nada Miljkovic ;;; Dissection by G. Craig Hobbs 01.25.08 ;;; 0 sliders ;;; graphics window ;;; 35x35, 12, center, torus turtles-own [radius] ;; sets variable radius for each turtle to setup ;; begin procedure setup ca ;; clear all crt 1 ;; create one turtle ask turtle 0 [ ;; run the given commands on the agent turtle set size 2 ;; set turtle size to 2 set color blue ;; set color to blue set shape "turtle" ;; set shape to turtle set heading 0 ;; set heading to 0 degree (i.e 12 o'clock) set radius 0 ;; set radius to zero pendown ;; put the pen down to draw ] ;; end commands end ;; end procedure to step ;; begin procedure step ask turtles [ ;; run the given commands on the agent turtle set heading (heading + 10) ;; set the heading to current heading + 10 degrees set radius (radius + .005) ;; set radius to current radius + .005 patches fd radius ;; move forward radius if not can-move? radius[ die ] ;; if turtle can not move without violating the topography (the area of the graphics window), then kill the turtle ] ;; end commands end ;; end procedure to go ;; begin procedure go step ;; advance ticker once end ;; end procedure ;;; end: spirals