Learn creative coding writing simple programs

18. Things that happen sometimes

This is the second time we compare a random number to a given number to make an event happen only sometimes, not always. Changing the given number we can make the event more or less probable. We test different numbers while animating some vertical lines that create something similar to a bar-code.

Tags: random

Code editor

You can make changes to the code below. Then

Questions and comments

Try to stay close to the topic of this episode. Use the Processing forums for help with unrelated Processing projects (or hire me for help ;-)

To indicate that a word in your comment is code, use the `backtick`. Example
Do `float` and `int` smell similar?
To highlight code blocks, surround it with ``` code-fences ``` like this:
``` void setup() { size(600, 600); } ```