General Description
This program tries to provide a forum for you to develop question and answer programs for the classroom. Two sets of example data are provided. The science data was developed for less able fourth years in a girls' school. The geography data is included to show the program's adaptability.
The program generates a strange introduction sound leading to an introduction page on which the scoring and rules are displayed. You start with 50 points and lose a small number of points for the help that you require - the largest loss being 5 points for a fruitless guess. Entry is single key, with a confirm check for every data entry except the final guess, to which you are committed. Success is rewarded with a 50 point bonus and a chance to play the game with your new total.
The main program displays a screen of up to eight YES/NO questions. Keying the number next to the question generates a response to the question. Typing 'H' moves onto the HELP pages. A list of all the possible answers is free and is obtained by typing 'G' for 'general' help. Special hints are obtained by typing 'S', 'R' returns you to the main program. In the main program 'Z' generates the surrender page and noises, while 'X' allows you to enter your guess.
It is possible but very difficult to use up all your 50 starting points, in which case you are deemed to have failed and a suitable message is created. When you lose all your points or 'give-up' the correct answer is displayed along with all the correct YES/NO attributes.
ADAPTABILITY
For those who wish to develop their own data, the following points should be noted.
Line 4580 contains the title (30 characters or less).
4590 contains the repetitive part of the free hint message. If nothing is to be indicated here then enter "" as the data.
4600 contains the number of the questions to be asked. This may vary from one to eight. Eight fits nicely onto the screen but the screen does readjust for other totals. Greater than eight questions, means that you will have to rewrite the screen display and update procedures to fit the extra questions in.
4610 contains the number of data items that follow. This MUST be an EVEN number of data items. The program has been tested up to 34 data items, and should run happily for up to a hundred, but if you choose a larger number of data items, you will find the HELP pages take a little longer to come up.
4620 up to 5990 may contain data. This must be in the following format: the item being tested, followed by its code (see below), followed by the free hint. If you are not having a free hint, this must be a "".
DATA CODES
The clue to these codes is in data line 4520. Each question has a number equivalent to the question. Thus question one has value 1 while question eight has value 128. 'PARIS' has code 1 because 'it is a capital' (question 1) and code 4 because 'it is on a river' (question three). Add these together and the code for 'PARIS' is 5 . . . QED.
IF YOU DO NOT HAVE EIGHT QUESTIONS
The validation checks will need to be changed in lines 1600 and line 1630 if you decide not to have eight questions. Thus for four questions only, line 1600 would read: 1600 Check$ = '1234ZXH':GOTO1650.
DO NOT RENUMBER THE PROGRAM or the computed RESTORE in lines 1980 and 1990 will fail.
QUESTIONS
These must occupy data lines 6000 and upwards.
For a program which is 500 statements long, there are remarkably few changes that need to be made to make the program run for a completely different subject area.
Detailed Description
Lines 10-370 The main structure: this is virtually self-documenting. It calls sub-structures 'help' and 'question'. QUESTION in line 230 is set to zero by default if a question number is not pressed and Z, X or H are pressed.
380-670 These are two main sub-structures. The flag SPECIAL controls which advice will be displayed in line 2630.
680-1020 It is possible but inadvisable to radically alter the screen display. I have fiddled with it to get it as it is. However note that the '9' in line 1000 is one less than the number of non-question display lines on the screen, starting from the top. There are several different methods of doing line 1010 - try for yourself and tell me.
1030-1120 Note that the question 'get' area is cleared at lines 1110 and 1120.
1230-1500 The guts of the program lies in the logical 'AND' performed in line 1330. For the technical, the bit-value is its decimal value flagged on an 8 bit register. 'Value' is obtained from each items' data line. The bit values are given in line 4520.
1510-1860 The validation is based on a suggestion I give elsewhere in the book. The delay routine is as suggested in the manual.
1870-2420 Don't fiddle with the initialisation unless you know what you are doing. The screen introduction you can improve upon, I suspect.
2430-2630 Unlike the rest of the help menus, these are easy to follow.
2660-3520 Though the special and general help routines have much in common, there is not sufficient to warrant drawing on similar procedures. Lines 2810-2850 determine the fact that there must be even numbers of data. Line 3400 performs another logical AND to sort out the final display for losers. If you can read the indenting on BBC Basic then the REPEATS fall into place - suffice it to say that exit back to the main program involves falling out of the layer of the onion your loop has currently crept into.
3530-4370 These may be altered at will. The A% in lines 4770 and 4290 are essential as the CLEAR in line 160 will clear all but the 'resident variables A% - Z%".
4380-4480 Keep these error trapping lines - you never know what you will find.
Data lines explained above.
Educational Notes
This program should be used in small groups, a maximum of four, round a single machine. The structure of the program lends itself to the less able, unless for the more able you are prepared to generate a large and challenging amount of data. The only point that the users of the program must realise, is to use the general help page for the set of answers. Looking at the science data, you can understand why: a sulphur rod and sulphur powder have some different physical characteristics and so sulphur on its own cannot be a suitable response. Similarly the ruler must be wooden!