Seawall Game

Only your skill at sums can save you from the awful octopus. Number fun for infants.

Volume 2

Number 2

April 1984

Get your sums right, or the octopus will have you!

By STEPHEN LOVICK

YOUNG Ben has to build the sea wall before the tide comes in. He needs five bricks to do it but the demon maths master will only provide him with bricks if he gets the answer right.

If he makes too many mistakes, the dreaded octopus will get him. But if he succeeds the positions are reversed.

This program was written for my four year old son who likes arithmetic. It sets problems involving addition and subtraction, the difficulty of which can be varied.

At level 0, the largest number met with is 8 and each rise of I in the level increases this maximum by 2.

Higher levels could provide practice in mental arithmetic for older children. And numbers of over a million are possible if you want to flummox the numerate adult.

Although the game is written in Mode 2, the colours have been chosen to be easily distinguishable on a monochrome monitor.

The program contains five envelopes. For OS 0.1 the last could be left out, lines 2320 to 2340 deleted and the last figure in line 2350 increased to 9.

MAIN PROCEDURES

PROCmanleft Move the figure in the direction
PROCmanright indicated.
PROCbench Draws the land.
PROCstack Draws the seawall.
PROCtitle Draws the title, called "Add and Subtract" to show what is happening.
PROCmanready Draws a stationary figure.
PROCadd and PROCsubtract Draw the Problem.
PROCaddans and PROCsubtractans checks the answers
PROCintro Produces the introductory page.
PROCsea Draws the sea and calls up ...
PROCwave ... to animate the waves, and ...
PROCoctopus ... to draw the octopus.
PROCendbad Produces the end effects if five correct answers are not given.
PROCendgood Produces the effects if five correct answers are produced. Both these use . . .
PROCmunch ... for sound effects.
PROCdefine Sets up the user defined characters and sound envelopes.

MAIN VARIABLES

try% Counts the number of answers attempted and positions the sea.
stack% Counts the number of correct answers and positions the bricks in the wall.
choice% Decides whether the problem will be addition or subtraction.
A%, B% and C% Used as figures in the problems.
ans The answer given by the program user.
D% Set at 0 or 1 depending on whether the answer is correct or not.
L% Decides the level of difficulty.
A$ The program user's name.
X% and Y% Coordinates to position the figure.
I% and O% Coordinated to position the octopus.