Kevin Thompson
Kevin Thompson

Reputation: 2506

NetLogo: Keep running

I know I've solved this in the past, but I can't seem to get it right today. I've written a very simple program that spawns 20 turtles and has them move around randomly. I click my setup and they appear. Then I click go and I get one tick. I have to keep clicking Go over and over to make the move.

How do I make it keep going when I click go one time?

to setup
  clear-all
  create-turtles 20 [
    setxy random-xcor random-ycor
  ]
  reset-ticks
end

to go
  ask turtles [
    move
  ]
  tick
end

to move
  rt random 40
  lt random 50
  fd 1
end

On the Interface tab I have view updates on ticks set.

Upvotes: 2

Views: 77

Answers (1)

Kevin Thompson
Kevin Thompson

Reputation: 2506

Found it. When I create the Go button I need to click the forever checkbox to keep it running forever.

Upvotes: 2

Related Questions