Classic Computer Magazine Archive COMPUTE! ISSUE 39 / AUGUST 1983 / PAGE 109

CLUES

Melvin Billik

An excellent teaching tool for preschoolers on up — with options to tailor the program for different age groups. For T1-99/4A and all Commodore computers.

As a teacher-administrator, I have found my PET extremely useful in creating programs for courses I teach, such as BASIC Programming and Statistics. In addition, other programs help me with administrative tasks, such as grading, transcript evaluation, teacher scheduling, and attendance.

However, as a parent of two preschoolers, I get the most satisfaction from writing programs for them. One such program is "Clues." It is fairly simple and can easily be modified for other microcomputers.

The youngster is asked his or her name, followed by a series of questions. A correct response by my son will yield a flashing message, "OKAY — GREAT, KEITH!" For an incorrect response, the question will be repeated. For two consecutive incorrect responses, the answer will be given and a new question will be asked.

For the Commodore version, the data is listed (question first, then answer) from line 700 on up. Line 1, the DIM statement, sets a maximum of 200 questions and answers. You can change this as your computer's memory size dictates. The program itself counts the number of questions and answers. Note the flag in line 1940.

Modifications

The program picks the questions at random. However, you can easily adjust the program so that no question is asked more than once by adding a new array variable as a flag (a value of 0 indicates the question has not yet been asked). For the Commodore version, add:

1 DIM C$(200), CA$(200), FL(200)
45 IF FL(X%)<>0 THEN 40
55 FL(X%) = 1

As more and more questions are asked, program execution time is slowed considerably (as the program searches for unasked questions). However, as long as you've asked less than 90 percent of your available questions, time delay is not a problem.

The game will continue until the player decides to quit, either by pressing the RETURN key in response to a question or by turning off the machine. If you made the previous program modification, the game can continue until all the questions have been asked. You can modify the Commodore version of the program to ask a specific number of questions as follows:

230 PRINT "HOW MANY QUESTIONS, MAX OF ";N
240 INPUT NQ: IF NQ>N THEN 230
250 RETURN
19 FOR II = 1 TO NQ
70 IF A$ = CA$(X%) THEN I = 10:GOSUB 500: GOTO 100
100 NEXT II

You can also adjust the level of questions to be suitable for a user's educational level. The subroutine starting in line 500 of the Commodore version, while exciting for a preschooler, might not be appropriate for an older child. An alternative might be to include a number of cute sayings and print one at random for a correct response. For example, we can replace the subroutine with:

500 Z = INT(3*RND(TI) + 1)
510 ON Z GOSUB 520,530,540
515 FOR I = 1 TO 1000: NEXT
519 PRINT "CLR": RETURN
520 PRINT "NOT BAD"
525 RETURN
530 PRINT "BET YOU CAN'T DO IT AGAIN"
535 RETURN
540 PRINT "BOY, ARE YOU LUCKY TODAY!"
545 RETURN

Also, Clues can be a good teaching tool: you can store a few hundred questions and using the modifications, generate a 10-25 question quiz. No two students would have the same quiz.

A question and answer sequence appropriate for preschoolers. "Clues," VIC version.