As it stands, ACTIVITIES is an educational program for use by younger schoolchildren. It could, however, be modified so that it could be an asset to older children as well.
It has been used by the teachers at my children's school in a slightly modified form on their disc-based BBC Micros, and they tell me it is useful and well liked (although maybe they're just being polite).
The idea is to test a child's powers of observation and association. The Electron selects a random activity from a list and draws some items on the screen which are associated with that activity. It also draws some irrelevant items.
The child's task is to decide which items are relevant and select them by pressing number keys 1-6.
If the selected item is relevant then it's ticked and the computer plays a chord, otherwise the drawing is crossed out and the computer makes a rude noise.
When the child thnks that he or she has all of the right items selected then they can press the F key, whereupon the computer will assess how well they have done.
Any drawings which should have been selected but were not are left on the screen, along with a comment. All irrelevant or correctly selected ones are rubbed out.
After ten activities (none of which are the same), a score sheet is printed and another turn is invited.
The initial instruction page can be returned to at any time by pressing the ESCAPE key and the sound effects can be turned on or off whenever the computer is expecting a key to be pressed.
Although this all sounds very daunting, in fact most children seem to be able to use the program easily and enjoy doing so.
My children run it on our Electron, but the program was originally written on a BBC, and because I am a lazy typist I'm afraid that the variable and procedure names are in upper case.
Also, because memory is at such a premium in the otherwise superb BBC/Electron computers, the variable and procedure names are rather cryptic.
Because of the way the program works, it is essential that you do not renumber it, or at least the DATA statements at lines 10000 onward.
At this juncture it's worth outlining how the program works.
I have seen many programs of a similar nature which require access to a set of data in a random way - spelling games or Hangman spring to mind.
Most programmers seem to access the data in a random way by READing the data into a string array then generating a random number to be used as an array index.
Doing this means that there are two copies of the data in the afore mentioned limited Acorn memory. (When is some bright spark going to bring out a main RAM expansion for the Electron, like there is for the BBC?)
Because it is possible in BBC Basic to use the RESTORE statement using a variable or an expression rather than a line number, any DATA statement can be READ by setting the value of the variable to the line number of the DATA statement that you want.
It looks tricky, but in fact is very easy. This means taht you must be careful how you number the DATA statements.
Finally, to save memory space and speed up the drawing process a bit, the resident integer variables have been used to some degree.
As I have already hinted, it is possible to add extra activities and drawings to the list or create a compeltely different one.
To create a new activity you must add a new DATA statement as follows (numbers are counted from 0):
100nn DATA activityname,n1,n2...ni,*
where nn is the number of the activity and n1,n2 etc are the numbers of the associated items.
There can be from one to six items in the list. The asterisk at the end is to tell the computer there are no more items in the list.
Line 19999 with the hash sign must be present to show there are no more lists. Each individual drawing is defined as shown:
200nn0 DATA itemname,M,x,y,D,x,y,E,x,y,r1,r2,a1,a2...,*
where nn is the item number and x and y are the coordinates of a 500 x 200 grid on which the item is drawn. The graphics interpreter reads these codes as follows:
M,x,y: Moves the graphics cursor to x,y without drawing
D,x,y: Draws a line to x,y from the last graphics point
E,x,y,r1,r2,a1,a2: Draws part of an ellipse with centre x,y radii r1,r2 starting at angle a1 and finishing at angle a2
The angles are measured in readians and increase anti-clockwise with 3 o'clock being zero
These codes may be in any order, but there is no error trapping, so they must be correct.
The asterisk at the end of the statement is to indicate the end of the drawing. If the codes will not all fit into one DATA statement they may be continued into another one, although the line number for this must be less than ten more than the initial one (for example, see lines 20100 and 20102).
The final DATA statement with the # indicates no more drawings are present, and it must be there.
If some clever dick of a little Johnnie points out that a so-called irrelevant item goes with an activity, just add its number to the activity list.
By Keith Turner
Aliens are gathering strength on a very high, walled plateau in a remote part of the globe. All airborne weapons have proved ineffective against them, but it is known that the heavy proton gun can destroy them.
The problem is that it is so heavy that it can only be used from the ground and because of the position of the aliens you cannot get a direct shot at them.
The fleet commander has come up with a brilliant but dangerous solution by fitting the remaining airships with reflective material on the base.
The brave pilots have put their lives on the line by flying back and forth over the alien's position to provide you with a mirror to fire at and thereby reflect your photons on to the aliens.
If you miss the mirror and hit the ship it will be destroyed - and you only have five of them.
Every now and then the aliens launch a bomb which bursts above you and showers you with high explosive mini-bombs.
While in flight this bomb also disables your fun - most frustrating, but this is what we learn to live with in computerland!
In order to score you have to position your "sight" so that the photon hits the mirror on the airship and the reflected photons meet the alien.
The sight is a "+" at the top of the screen and is the point through which your photons will pass if not interrupted by the mirror.
Once fired, the photon's path is set and cannot be changed - it cannot be guided.
As both the ship and the alien are always moving a hit with every shot would be miraculous.
For this reason there are no levels, and the idea is to score more hits than anyone else before you are killed.
||X coordinate of sight
||X coordinate of base
||X coordinate of photon
||Y coordinate of photon
||X coordinate of bomb
||Y coordinate of bomb
||X coordinate of ship
||X coordinate of alien
||Movement rate of alien
||Horizontal movement rate of photon
||Veritcal movement rate of photon
||Movement rate of ship
||Random time before bomb is launched
||Has bomb been launched?
||Is game finished?
||Has photon gun been fired?
||Coordinates for shower bombs
||Names on hi-score table
||Draws battle scene, score, etc
||VDU 23s, initialises variables
||Creates new ship
||Creates new alien
||Moves sight on your command
||Moves base on your command
||Photon launched, sound, flight until result of shot
||Rubs out what was hit and shows explosion
||After random time, called to launch bomb
||Bomb bursts and showers down mini-bombs
||Compares score with previous scores
||If hi-score asks for name and displays table
||Calls Mode 6 and reports error