You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 9, 2018. It is now read-only.
The first (outer) loop runs once and executes its contents (470 - 170 = 300) times. This way, we move from the leftmost side of our rectangle to the rightmost side.
The second (inner) loop runs as many times as the x varaible changes. Each time the outer loop executes its contents, the inner loop makes (340 - 140 = 200) executions. In this loop the y moves from top to bottom.
This way, pixel x, y runs (300 \times 200 = 60000) times with various values of x and y!
You can nest more than two loops. What you should be wary of is that program speed degrades drastically with each loop you nest.