Programming Course for Beginners - ZedLX

The Easiest Online Computer Programming Course, for Free

while Loop and Keyboard [3/11]

This program increases the variable i until the Esc key is pressed.

Run the program, and then use the Escape key to end it.

Change the println statement in the loop into a following statement: println "i: ", i.atmost(13);

Then, try to figure out what is the purpose of the getter atmost.

Then, try changing the inserted statement to use the getter atleast instead of atmost.

* * *

Note for touchscreen users only: you can try changing the condition of the while loop into not isPressed("touch").

Loading...