Square Spiral

Square Spiral preview image

1 collaborator

Default-person Eli Horton (Author)

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by the author
Model was written in NetLogo 5.1.0 • Viewed 259 times • Downloaded 30 times • Run 0 times
Download the 'Square Spiral' modelDownload this modelEmbed this model

Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)


Comments and Questions

Please start the discussion about this model! (You'll first need to log in.)

Click to Run Model

turtles-own [stepsize] 

to setup
  clear-all
  setup-turtles
  ask turtles [ set shape "turtle" ];; turtles will be turtles 
  reset-ticks
end 

to go
  square_spiral ;; creating a variable for square spiral
  tick
end 

to setup-turtles
  create-turtles AmountTurtles [ setxy random-xcor random-ycor ;; puts the turtles in random positions before the start of the model
    set stepsize 10 ]
end 

to square_spiral ;; the variable square spiral
  ask turtles [ ;; start of the command to tell my turtles to move
    pd ;; fairly self explanitory, 
    right angle ;; instead of a number value, "angle" is the variable that can be found on the drop down menu on the interface tab
    fd stepsize
    if stepsize != 0 [ ;; this this what helps the agent do the victory dance, letting them know not to go any lower if the stepsize equals zero
      set stepsize stepsize - .5 ;; decrases step size to make accurate shapes and less space between the lines
      ] 
    
    if (count turtles-here > 1) [
      
      ask turtles-here [ set stepsize 10]
      
    ]
        
    if (count turtles-on neighbors > 0)[
     
     ask turtles-on neighbors [set stepsize 10]
     ask turtles-here [ set stepsize 10]
     
    ]

   
  
  ]

   tick
end 


  


There is only one version of this model, created over 10 years ago by Eli Horton.

Attached files

File Type Description Last updated
Square Spiral.png preview Preview for 'Square Spiral' over 10 years ago, by Eli Horton Download

This model does not have any ancestors.

This model does not have any descendants.