The Best of Creative Computing Volume 1 (published 1976)

Page 239 << PREVIOUS >> NEXT Jump to page:
Go to contents Go to thumbnails

A Universal Word Game in BASIC (BASIC game for vocabulary building)

graphic of page

A Universal Word Game in BASIC

by Barney M. Milstein

Associate Professor of Literature

Stockton State College

Pomona, N. J.

     This article describes an interactive paedagogical game written in BASIC
for vocabulary building work in any natural language. Although the game as
presented here is intended for antonym-matching, it can easily be modified to
test definitions, either in the target natural language, or in the native
language, as with remedial work. The version discussed below is for German; the
program is named SPIEL1.

     The same is played by presenting the student with three rounds of ten words
each. Lexical items are ordered in each of three groups according to increasing
difficulty. In order to advance a round, the student must match at least seven
correct answers on the first attempt; otherwise he is ejected from the game at
the end of the respective round. In case of errors, the correct answer is
displayed for the student, and he must enter it before proceeding to the next
item. At the end of three rounds, the student is given a 'rating' on a scale
from 15 to 30. The parameters of the ratings, as well as those for advancing a
round, are arbitrary and alterable at the will of the programmer.

     Items are selected at random from a data array. In order to keep items from
repeating, a flag is set on both the question and its antonym (i.e. the correct
answer).

     The reader is asked to consult the accompanying program listing for
references to specific line numbers. The program as it appears here is
implemented on the E. I. S. network in New Jersey.

     Lines 70-280 contain instructions, and are self-explanatory. They should be
modified in appropriate places for use with other languages, or with
variations.

     If the parameters for the ratings (lines 280-350) are altered, accompanying
changes must be made in the conditions set in lines 790-860: these determine
which message will be displayed to the student at the conclusion of the game.

     Lines 360-380 are used in conjunction with the generation of a random
number. ln the CALL-OS system as used by E. I. S., the 'rnd' function can be
provided with a 'throwaway' variable ('a'); this will produce a different
sequence of random numbers if a different number for 'a' i s entered each time
the program is run.

     The Dimension Statement is routine. In this case 216 items are present in
the German array, with the variable 'w$' being the literal string. The variable
'f' i s used to flag items for non-repetition.

     Lines 410-440 initialize the three counters used in the game. C1 keeps
count of correct answers in each round, and is again initialized at line 960. C2
keeps count of the absolute number of problems generated, and is used for going
from one round to the next. C3 keeps a cumulative count of the total number
matched correctly on the first try.

     Lines 490-510 read in the literal items, which are stored as a data array
of word pairs in lines 2000-4135. Care has been taken to keep all three sets of
words equal in size, although this is not a strict necessity. In any case, the
line numbering system used (2000-3000-4000) allows for expansion without the
necessity for renumbering.

     Line 520 is the beginning of the loop of ten problems per round. Since the
absolute total of problems encountered is incremented in C2 (line 620), lines
530 and 540 determine from which group of items the test item will be selected.
Thus, if C2 is less than 10, control passes to line 590, which sets a variable,
'z', equal to a random number between 1 and 72. If the student passes
successfully through the first round, the condition set at 530 will be met, and
control will pass to the number generator for the next round (570), and so on.

     Lines 550, 570 and 590 generate random integers in the proper ranges for
the three parts of the game. The number generated corresponds to the subscript
of the literal variable 'w$', against which the student input ('x$' in lines 640
and 670) will be matched. The parameters of the generator are determined by the
size of the array and the manner in which it is divided. In this case, the
integers will be generated to fall between 1 and 72, 73 and 144 and 145 and 216.
The random number actually generated by the function 'rnd' is between 0 and 1,
thus necessitating some arithmetic to bring it to the proper value.

     Lines 600 and 610 set a flag on the subscript variable 'z', sending control
back to line 530 if that number is encountered a second time.

     Line 615 displays to the student one of the 72 words in each main section.
The 'correct answer' is a string corresponding to the other half of the word
pair in the data array. Since the integer generated at random may be either odd
or even, the correct answer matching 'x$' will be either 'w$(z+1)' (odd) or
'w$(z-1)' (even). By using the integer function ('int') to determine oddness or
evenness of 'z' (line 630), control is branched to either 650 or 675 for a match
test.

239

Page 239 << PREVIOUS >> NEXT Jump to page:
Go to contents Go to thumbnails