/ Published in: Processing
In Processing: This is a basic example of a "for" loop. Relevant to almost any language.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
for(int i = 0; i < 20; i++) { println(i); } /* in a for loop first you define the int, then you type the condition i is less than 20 loop is active 3rd expression: what do you want to happen at the end of each loop, add 1 for instance i = i + 1 aka I++ i = i + 2 I += 2 I += 3 n = n - 1 n -- n = n - 2; n -= 2; */