detail from a million step random walk

a rectangle made up of many brightly-coloured  line and semicircle sections in a random arrangement
each line can be drawn at 0°, 60°, 120°, …, 300° and can be coloured red, orange, yellow, green, cyan or purple depending on direction. White areas are unfilled sections of the background

This is a tiny detail from an unfeasibly large random walk made in Berkeley Logo. The code looks something like this:

; random dice walk, with colours for each of six directions
; scruss, 2021-07

make "ch {14 6 2 3 13 4}
make "dirs {0 60 120 180 240 300}
make "sides {1 2 3 4 5 6}

to walk
  make "throw pick sides
  setheading item :throw dirs
  setpencolor item :throw ch
  forward 20
end

hideturtle repeat 1000 [walk]

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *