[Top] - [Next] - [Previous]

Post-Execution Options

There are two ways that the simulator can finish executing a Karel program: by having Karel execute a turnoff instruction or by having him perform an error shutoff. In each case an appropriate message is printed on your screen; if Karel stops because of an error shutoff, you will be given a detailed description of the error and where Karel's program was executing when it occurred. In either case, you will then be allowed to pursue one of the ollowing four Post-Execution Options:

     Options([B]ackTrace, [R]eExecute, [L]ook at world, or [E]xit)[B]:_

The following list briefly explains the meanings of the above mentioned options (in the reverse of the order in which the options are listed above).

The E command causes the simulator to Exit back to the MS-DOS operating system (where you will be presented with the > prompt). Type E only if you need to modify your Karel program or if you are finished using the simulator.
The L command allows you to Look at various portions of Karel's world that are not currently on the screen. For example, Karel might perform an error shutoff far away from the corner that started him on an errant path. You can use the L command to display the portion of the world containing that corner. When you are finished looking around the world, you will again be asked to supply a post-execution option.
The R command allows you to ReExecute your Karel program in a different initial situation. Typing an R to the Post-Execution Option prompt line will cause the simulator to reprompt you with the following request:
         Where to Get Initial Situation([B]uild or [R]ead from a file)[B]:_

Once you have read or built a new initial situation (or modified an old one), you will be prompted again for the three main Execution Options. Thus, you can test your program in many different initial situations without ever exiting from the simulator.

Finally, the B command allows you to execute your program forward and backward using the current initial situation. For each Backtrace that you request, you will also be prompted for the three main Execution Options. If your Karel program ran too fast the first time that the simulator executed it (or if it contained an error that you have not isolated), quickly execute the program backward to its beginning, and then execute it forward at a slower speed (or in Explain Mode).

[Top] - [Next] - [Previous]