This past week in class we were learning how to use loops in the program Jeroo. The way you type the code can make things very easy while at the same time very specific and efficient. You can do this by simply adding an exclamation point before a statement to do code based on whether the statement is true or not. For example, the statement used for a loop that runs as long as the jeroo bobby is not to the right of a flower may be, while(!bobby.isFlower(RIGHT)). This is helpful if you are trying to reach a certain goal. For example, if you wanted to get your jeroo to a point where he is next to a flower, the code from earlier would be appropriate. The loops in jeroo are easy to work with and can be very useful, and between all three programs I have worked with, it seems to be the best way to apply loops.
-jag13
No comments:
Post a Comment