NetLogo banner

 Home
 Download
 Help
 Resources
 Extensions
 FAQ
 NetLogo Publications
 Contact Us
 Donate

 Models:
 Library
 Community
 Modeling Commons

 User Manuals:
 Web
 Printable
 Chinese
 Czech
 Farsi / Persian
 Japanese
 Spanish

  Donate

NetLogo Models Library:
Code Examples

(back to the library)

Random Walk Example

[screen shot]

If you download the NetLogo application, this model is included. You can also Try running it in NetLogo Web

WHAT IS IT?

This code example is a demo of a basic random walk. At each step, the yellow turtle changes its heading randomly.

THINGS TO NOTICE

The turtle's pen is down, so it leaves a trail behind it in the drawing.

RELATED MODELS

Random Grid Walk Example: the same except that the random walk is constrained to lie on a grid

(back to the NetLogo Models Library)