TurboHAL is a program designed to teach programming logic and skills. There are only two action verbs in TurboHal, Move and Turn. All the rest of the built-in instructions are used to apply logic to TurboHAL. New instructions can be defined using the action and logic instructions. These newly defined instructions can be up to 20 characters in length. There can be only 5 newly defined instructions in TurboHAL. However, defined instructions can contain previously defined instructions.
Logic phrases must begin with either "If (i)" or "While (@)" and MUST be ended with End (z). The logic phrase must have a True section of instructions. The logical phrase can also have a False section of instructions separated from the True section by "Otherwise (o)". These sections can contain multiple instructions of the action verbs and defined instructions. A logical instruction must be Ended with End (z) before another logical instruction can begin. For that reason any defined instruction which contains a logical instruction set can NOT be used within a logical instruction phrase.
If you use an "Otherwise" with "While", you must wait until the program stops running before entering another instruction. If you do not wait, the new instruction will probably not be accepted by the program.
As you select instructions, they will be placed in the Instruction Text Box. You can at any time, insert new instructions into any place in the Instruction Text Box or even code the whole program in the Instruction Text box. If you make any changes to the text box, Play the program to make sure it is doing what you want.
TurboHAL is started by double clicking on any dot within a square. This will set the position of HAL. Then click in between two dots to place a wall. Continue this until you have built all the walls you want. If you want to remove a wall, just click on it. Next double-click on the dots between the walls to insert beepers. Insert as many beepers as desired. Now you are ready to start the program. You can do so by clicking on the built-in instructions, defining your own instructions, or by coding your own program in the Instruction text box, or any combination of the former. You can play the program at any time to check your results and you can remove instructions from the Instruction Text Box if necessary.
Once you are happy with the layout and program, then submit it. Make sure you put your name and EMAIL id at the top first.
TurboHAL Instruction Definitions
|moves HAL in the direction it is pointing up to the number of iterations requested. Default iteration is 1, maximum is 5.|
|turns HAL to the left for the number of iterations requested. Default iteration is 1, maximum is 5.|
|begins a logical instruction set. Must be ended with End. Instructions in the True area are only executed once.|
|begins a logical instruction set. Must be ended with End. The difference between If and While is that the instructions in the True area are executed until the While statement is False.|
|separates the instructions in the True area from the False area instructions. If used with "While", Otherwise will cause the instructions in the True area to be executed until the While statement becomes false. Wait until the program stops before entering anything else.|
|Front is Clear||
|check for a wall directly in front of the arrow|
|is the arrow facing North|
|is the arrow facing South|
|is the arrow facing East|
|is the arrow facing North|
|Beeper in Front||
|is there a beeper in the square in front of the arrow|
|Any beepers in bag||
|are there any beepers in the beeper bag|
|Left side clear||
|is there a wall in the square directly to the left of where the arrow is facing|
|Right side clear||
|is there a wall in the square directly to right of where the arrow is facing|
|MUST be used to complete an "IF" or "While" phrase|
|can be used with any of the logical question instructions. Must be used directly in front of the logical instruction (example "iuf" says "if not front is clear".|