CSE 5J Lecture Notes - Lecture 8: Ellipse, Bracket, Texas State Highway Loop 1
Document Summary
Cmps 5j - lecture #8 - while loops. While loops are set up as seen in the example; the condition comes after while and. Whatever is inside the following curly bracket is the block that will be executed is followed by a curly bracket. every time the condition is true. When this condition is false, the program exits the while loop. In example 1, the condition is (x < 8) found in line 10. The program is able to quit as x is constantly incrementing by 1 as found on line: when x = 8, then the condition is no longer true and the while loop ends. As the program keeps looping, the values of the rectangle are as follows. The blocks are drawn one by one from left to right. Note that moving the fill in and out of the while loop will affect. Placing fill and r,g,b, in the while loop will cause the program (ex.