General Description
The object of this next simulation is to compel the user to consider logical problem solving techniques in action in a (rather unlikely) real life simulation.
User instructions appear on the screen as soon as the program is run. The object of the exercise is to transport two men and two girls across a river. But there's a problem. The only available boat has a very limited capacity: at any one time it can only carry a maximum of one man and two girls. What is the minimum number of times that the boat has to cross the river before all four are on the other side?
Detailed Description
Lines 1-2 Is the first part of the 'Delete' trick.
10 Check for Escape key.
15-80 Sets up variables and sound.
90-110 Sets up colours.
120-160 Draw river
170-220 GOTO procedures.
210 Puts the boat on the opposite side of the river.
230-320 Displays G's and M's, also displays number of rides taken.
330-380 Check to see if everybody is on the same side of the river but not on the same side as where they started, if so, then go to finish.
390-430 Routine for finish
440-650 Get input from keyboard e.g. G, GG, or M, and validate. Also move person across river in memory but not visually.
660 Data for validation of keyboard input.
670-870 Move boat across river visually.
880-920 Escape key has been pressed.
1000-1130 Display instructions.
1140-1188 Second part of the delete trick.
Educational Notes
It is often difficult to demonstrate to students that logic has a place ion the real world, and that many problems are not most effectively dealt with by means of intuition or commonsense. Textbook examples often tend to reinforce the suspicion that logic is mathematics in the esoteric mode. This program has been designed to breathe a little life into logical examples.
Boating will run on both a Model A & B, and as the listing notes, it would be fatal to renumber this program.