Last active
August 29, 2015 14:02
-
-
Save FlyingJester/0861f36b49be69fe580d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const unsigned gWidth = 3; | |
| const unsigned gHeight = 3; | |
| for(unsigned y = 0; y<gHeight; y++){ | |
| for(unsigned x = 0; x<gWidth; x++){ | |
| // Stuff in here is done once for each x. | |
| // But, it's done gHeight number of times, since this loop is performed inside | |
| // the outer loop! | |
| // So, stuff in here is done gHeight*gWidth times. x and y look like this: | |
| // y, x | |
| // 0 0 | |
| // 0 1 | |
| // 0 2 | |
| // 1 0 | |
| // 1 1 | |
| // 1 2 | |
| // 2 0 | |
| //... | |
| } | |
| // Stuff here is done during each of the outer loop's | |
| // iterations, after all the stuff in the inner loop is done. | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment