[Top] - [Next] - [Previous]

Recognizing Infinite Loops in the Simulator

If the simulator ever believes that Karel's program might be in an infinite loop, it will ask the following question:

     WHILE loop may be infinite.  Do you want to continue([Y]es or [N]o)[Y]:_

Note that this question does not necessarily mean that your program is actually in an infinite loop; it just means that the simulator is not sure, and it would rather be safe than sorry. Before replying to this question, look at the current state of your program and the world. Decide whether your program is actually in an infinite loop, and then type your answer to this question. If you type an N, the simulator forces Karel to execute a "turnoff" instruction, and you can start debugging your program from there (using any of the Post- xecution Options). If you type a Y (or just press return, since Y is the defaul answer), the simulator continues executing your program.

If you request that the simulator continue executing your program, it may ask you the same question again, at a later time, allowing you further chances to cancel your program's execution.

[Top] - [Next] - [Previous]