Learn programming 34: Create a grid of objects with nested while loops from nested Watch Video
Preview(s):
Gallery
Play Video: (Note: The default playback of the video is HD VERSION. If your browser is buffering the video slowly, please play the REGULAR MP4 VERSION or Open The Video below for better experience. Thank you!)
Description: We have seen in previous episodes how to create many objects at once using a while loop. This time we use a while loop inside a while loop to create a grid of objects. The result is a collection of objects (rectangles or circles in our example) distributed in the screen in a pattern similar to the white and black rectangles in a chess game.nUsing a loop inside a loop is something very common in programming, and we will see more examples in coming episodes.
Play Video: (Note: The default playback of the video is HD VERSION. If your browser is buffering the video slowly, please play the REGULAR MP4 VERSION or Open The Video below for better experience. Thank you!)