loop and conditional demo

Here's the source.

Quick quiz : why is there sometimes one equal (like in "i = i + 1") but sometimes two equals (like in "if (i==3){...}") ?