Turtle Random Walks

Words
107
Reading
1 min
Listen
Play
8y

turtlegraphics@turtlegraphics aims to provide a set of simple-to-follow-and-fun-to-learn examples for Logo Programming, which is known as Turtle Graphics for both parents and kids!.

Logo Programming Source

cs to randomwalk
  repeat 100 [
    make "r parseInt(:random*3)
    if :r==0 [fd 20]
    if :r==1 [rt 90 fd 20]
    if :r==2 [lt 90 fd 20]
  ]   
end
randomwalk

:random returns a float number between 0 (inclusive) and 1. parseIntis a Javascript function that converts to integer. Please note that the expression in this LOGO version must not have spaces.

Screenshot

image.png

Logo Software

https://chrome.google.com/webstore/detail/logo-turtle/dcoeaobaokbccdcnadncifmconllpihp

If you like this idea and update...

turtlegraphics@turtlegraphics and the LogoTurtle is maintained by justyy@justyy

Support him and his work as a witness by

  1. voting him here, or
  2. voting him as a proxy

Some of his contributions: SteemIt Tools, Bots, APIs and Tutorial Thank you!

Turtle Random Walks | Ecency