TurSquiral
Model was written in NetLogo 6.1.1
•
Viewed 729 times
•
Downloaded 68 times
•
Run 0 times
Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)
Info tab cannot be displayed because of an encoding error
Comments and Questions
Please start the discussion about this model!
(You'll first need to log in.)
Click to Run Model
;; --------------------- TurSquiral ---------------------------------------------------------------- ;; ----------------------------------------------------------------------------------------------------- globals [ side step ] turtles-own [state] to setup clear-all ask patches [set pcolor white] crt 1[set heading -90] ;; starting with different heading angle, you could get different outputs reset-ticks end to patch-draw if mouse-down? ;; reports true or false to indicate whether mouse button is down [ ask patch mouse-xcor mouse-ycor [ set pcolor orange display ] ] end ;; Squirals ;; ----------------------------------------------------------------------------------------------------- to go_squiral set step 0 ask turtles [ walk ] ask turtles [ rt angle ] set side side + increase tick-advance 1 end to walk set pcolor sky set step step + 1 fd 1 if step <= side [walk] end ;; Turmites ;; ----------------------------------------------------------------------------------------------------- to behaviour1 ;; the Langton's ant if pcolor != white [set pcolor white lt 90 fd 1] if pcolor = white [set pcolor sky rt 90 fd 1] end to behaviour2 if pcolor = white and state = 0 [set pcolor sky lt 90 set state 0 fd 1] if pcolor = white and state = 1 [set pcolor white rt 90 set state 0 fd 1] if pcolor != white and state = 0 [set pcolor white lt 90 set state 1 fd 1] if pcolor != white and state = 1 [set pcolor sky rt 90 set state 1 fd 1] end to behaviour3 if pcolor = white [set pcolor magenta rt 90 fd 1] if pcolor = magenta [set pcolor sky rt 90 fd 1] if pcolor = sky [set pcolor orange lt 90 fd 1] if pcolor = orange [set pcolor white lt 90 fd 1] end to behaviour4 if pcolor = white and state = 0 [set pcolor sky rt 90 set state 0 fd 1] if pcolor = white and state = 1 [set pcolor white rt 0 set state 0 fd 1] if pcolor != white and state = 0 [set pcolor sky rt 90 set state 1 fd 1] if pcolor != white and state = 1 [set pcolor white rt 0 set state 1 fd 1] end
There are 7 versions of this model.
Attached files
File | Type | Description | Last updated | |
---|---|---|---|---|
TurSquiral.png | preview | Preview for 'TurSquiral' | about 6 years ago, by Cosimo Leuci | Download |
This model does not have any ancestors.
This model does not have any descendants.