to setup ca crt 1 ; create one yellow turtle ask turtles [ set color yellow ] end to do-random-walk ask turtles [ rt random 360 ; set random heading forward 1 ; advance one step stamp blue ; stamp blue the patch that has been visited wait 0.1 ; delay execution so that the code does not run too fast ] end ; This model was created as part of the project: CONNECTED MATHEMATICS: ; MAKING SENSE OF COMPLEX PHENOMENA THROUGH BUILDING OBJECT-BASED PARALLEL ; MODELS (OBPML) ; The project gratefully acknowledges the support of the National Science ; Foundation (Applications of Advanced Technologies Program) -- grant numbers ; RED #9552950 and REC #9632612. ; ; Converted from StarLogoT to NetLogo, 2001 ; Copyright 1999 by Uri Wilensky. All rights reserved. ; ; Permission to use, copy, or modify this software and its documentation for ; educational and research purposes only and without fee is hereby granted, ; provided that this copyright notice and the original authors' names appear ; on all copies and supporting documentation. For any other uses of this ; software, in original or modified form, including but not limited to ; distribution in whole or in part, specific prior permission must be ; obtained from Uri Wilensky. These programs shall not be used, rewritten, or ; adapted as the basis of a commercial software or hardware product without ; first obtaining appropriate licenses from Uri Wilensky. We make no ; representations about the suitability of this software for any purpose. It ; is provided "as is" without express or implied warranty. @#$#@#$#@ CC-WINDOW 13 142 310 317 Command Center BUTTON 81 66 136 96 NIL setup NIL 1 T OBSERVER BUTTON 152 66 207 96 Go do-random-walk T 1 T OBSERVER GRAPHICS-WINDOW 321 10 645 334 40 40 4.0 1 @#$#@#$#@ WHAT IS IT? ----------- This code example is a demo of a basic random walk. At each step, the yellow turtle changes its heading randomly. The patches visited by the turtle are stamped blue. @#$#@#$#@ default true 0 Polygon -7566196 true true 150 5 40 250 150 205 260 250 @#$#@#$#@ NetLogo 1.0 Beta 5 @#$#@#$#@ @#$#@#$#@ @#$#@#$#@