# TurSquiral

Model was written in NetLogo 6.0.1
•
Viewed 290 times
•
Downloaded 8 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

globals [ side step ] turtles-own [state] to setup clear-all crt 1[ set heading -90 set state 1 ] reset-ticks end to patch-draw if mouse-down? ;; reports true or false to indicate whether mouse button is down [ ;; mouse-xcor and mouse-ycor report the position of the mouse -- ;; note that they report the precise position of the mouse, ;; so you might get a decimal number like 12.3, but "patch" ;; automatically rounds to the nearest patch ask patch mouse-xcor mouse-ycor [ set pcolor red display ] ] end to go_squiral set step 0 ask turtles [ walk ] ask turtles [ rt angle ] set side side + increase tick-advance 1 end to turmite1 ask turtles [ behaviour1 ] tick-advance 1 end to turmite2 ask turtles [ behaviour2 ] tick-advance 1 end to turmite3 ask turtles [ behaviour3 ] tick-advance 1 end to walk set pcolor blue set step step + 1 fd 1 if step <= side [walk] end to behaviour1 if pcolor != black [set pcolor black lt 90 fd 1] if pcolor = black [set pcolor green rt 90 fd 1] end to behaviour2 if pcolor != black and state = 1 [set pcolor black lt 90 set state 2 fd 1] if pcolor != black and state = 2 [set pcolor green rt 90 set state 2 fd 1] if pcolor = black and state = 1 [set pcolor green lt 90 set state 1 fd 1] if pcolor = black and state = 2 [set pcolor black rt 90 set state 1 fd 1] end to behaviour3 if pcolor = black [set pcolor red rt 90 fd 1] if pcolor = red [set pcolor yellow rt 90 fd 1] if pcolor = yellow [set pcolor cyan lt 90 fd 1] if pcolor = cyan [set pcolor black lt 90 fd 1] end

There are 3 versions of this model.

## Attached files

File | Type | Description | Last updated | |
---|---|---|---|---|

TurSquiral.png | preview | Preview for 'TurSquiral' | 5 months ago, by Cosimo Leuci | Download |

This model does not have any ancestors.

This model does not have any descendants.