Java StarLogo 1.0 `turtle` to move-turtles seth 90 + (random 2) * 180 fd 1 setpc yellow end to calc-tmax-tmin settmax max (abs xcor) tmax settmin min (abs xcor) tmin end `observer` globals [step average dist tmax tmin] to setup ca crt screen-width setplot-title "Random Walk" setplot-ymax 10 setplot-ymin 0 setplot-xmax 100 ask-turtles [ setc red setxy 0 (who - screen-half-width) ] end to ogo settmax 0 settmin 100000 ask-turtles [ move-turtles calc-tmax-tmin ] setstep step + 1 setaverage (sum-of-turtles [xcor]) / count-turtles setaverage round average setdist (sum-of-turtles [abs xcor]) / count-turtles setdist round dist plot dist setplot-title se "N/Avg/Dist:" se step se average se dist se "Max/Min:" se tmax tmin end