Classic Computer Magazine Archive COMPUTE! ISSUE 87 / AUGUST 1987 / PAGE 8

Easy Language Drill

I am studying a foreign language. I want to be able to display the foreign language word and, after a delay of a few seconds, have the English equivalent appear. The foreign language words should appear in a different order each time the program is run.

Don Moschenross

The following short program will work without modification in BASICA on the IBM PC/PCjr, Microsoft BASIC for the Amiga or Macintosh, ST BASIC, and any version of Commodore BASIC. The program displays Spanish and English words; to drill in another language, simply substitute the appropriate words in the DATA list at the end of the program. You can also add more word pairs; change the DIM statement in line 110 to match the number of word pairs you wish to use. Different versions of BASIC run at different speeds; if you find that the delay is too short, increase the number 2000 in lines 250 and 270.

FE 100 REM array size is number of words
HP 110 DIM En$(3), SP$(3)
DO 120 REM -1 is the last data item
HC 130 READ ENGLISH$, SPANISH$
CB 140 IF ENGLISH$-"1" THEN 180
FP 150 EN$ (N) = ENGLISH$ : SP$(N) = SPANISH$
CC 160 N = N + 1 : GOTO 130
IF 170 REM generic randomizer
FD 180 INPUT "Enter a number between 1 and 9999";X
FL 190 FOR J = 1 TO X : T = RND (1) : NEXT
AC 200 I = INT (RND (1) $N)
KJ 210 IF NR = N THEN PRINT" all the words in the list have" : PRINT" been displayed." : END
DK 220 IF T(I) = 1 THEN 200
HK 230 PRINT" Spanish : ";SP$(I)
BL 240 REM delay loop
KD 250 FOR J=1 TO 2000 : NEXT J
DB 260 PRINT" English : "; EN$ (I);
JI 270 PRINT : FOR J = 1 TO 2000 : NEXT J
MJ 280 T(I)=1 : NR = NR + 1 : GOTO 200
OK 290 DATA dog, perro, cat, gato, door, porta, one, uno, -1, -1