I'm sure this is something most of you already know but I find interesting pointing out at one topic I've realized using
@drawbotapp

While reading "The Nature of Code" and translating it into #Python I've found out how "random" are methods such as #randint and #choice.
"The Random Walker" is an early exercise to simulate the randomness of nature (not really).

The idea is to use a random factor to create a line from an (x, y) coordinate to another one of the possible the eight directions (up, down, left, right,…).
Well, here's the thing, there are eight options to choose in which direction to go. And here's the result depending on the chosen method.

Randint:
Within the logic of the code, the "random walker" would tend to go up-right.
Choice:
In this case, with a given list from 0 to 7, the "random walker" would go mostly to the right.
I'm not discovering anything, but I find really helpful to use Drawbot and Python to be able to "see" such abstract concepts as randomness.

Maybe this is something we all should be aware of if we work with code. Maybe I just wanted to post some graphics.
Something we all should be aware of is how tiny pieces of code can massively change the output. Forget anything before in this thread.
You can follow @laprenent.
Tip: mention @twtextapp on a Twitter thread with the keyword “unroll” to get a link to it.

Latest Threads Unrolled: