This program is a French vocabulary quiz that tests the user on up to 20 English-to-French word pairs stored in DATA statements. It uses a random selection mechanism combined with a DIM A(20) tracking array to avoid repeating questions within a single session. Each round picks a random entry from the DATA list, checks whether it has already been asked via the array flag, and re-draws if so. The program uses colour attributes (PAPER, INK, FLASH, BRIGHT) extensively for visual feedback on correct and incorrect answers, and BEEP pitch is tied to the running score (2.5*SCORE) for a pleasing escalating reward sound. At the end of the session the program loops back to the start with RUN rather than GO TO 20, which resets all variables including the score and the tracking array.
Program Structure
The program is organised into three broad phases:
- Initialisation (lines 20–90): Sets colours, dimensions the tracking array, displays a welcome screen, and validates the number of questions requested (1–20).
- Question loop (lines 100–240): A
FOR Cloop iterates over each question. Within it, aFOR Dloop reads randomly into the DATA list to pick a question, checks for repeats, then prompts the user and evaluates the answer. - End-of-game (lines 250–270): Displays the final score with flashing text, then calls
RUNto restart entirely.
Question-Selection Mechanism
Random question selection is achieved by generating a random integer INT(RND*20)+1 (stored in D) and then READing through the DATA list D times to land on that entry. Each DATA triplet contains the English word (E$), the French word (F$), and a unique integer index X (1–20). The array A(X) acts as a “seen” flag; if A(X)=1, line 150 branches back to line 110 to pick again. RESTORE at line 140 rewinds the DATA pointer before each selection so the READ loop always starts from the beginning.
Data Organisation
The vocabulary is stored across three DATA lines (280–300), each holding five triplets. Only 15 word pairs are actually defined (indices 1–15), yet the random number generator can produce values 1–20 and the array is dimensioned to 20. This means indices 16–20 can never be selected (there is no corresponding DATA), but the range mismatch does not cause an error because the repeat-checking loop will simply keep re-rolling until a valid, unseen index below 16 is chosen.
| Index | English | French |
|---|---|---|
| 1 | EVERYWHERE | PARTOUT |
| 2 | SELDOM | RAREMENT |
| 3 | OFTEN | SOUVENT |
| 4 | NEVER | JAMAIS |
| 5 | ALWAYS | TOUJOURS |
| 6 | VERY | TRES |
| 7 | MORE | PLUS |
| 8 | LESS | MOINS |
| 9 | YES | OUI |
| 10 | NO | NON |
| 11 | THANK YOU | MERCI |
| 12 | ONE | UN |
| 13 | TWO | DEUX |
| 14 | THREE | TROIS |
| 15 | FOUR | QUATRE |
Notable Techniques
- Score-linked BEEP: Line 200 uses
BEEP .1, 2.5*SCORE, so each successive correct answer plays a higher-pitched tone — a simple but effective audio reward ladder. - PAPER 9 (transparent): Line 170 uses
PAPER 9in the question header, which renders as “transparent” paper (inheriting the background), a useful idiom for mixed-colour lines. - RUN for restart: Line 270 uses
RUNrather thanGO TO 20. This clears all variables and re-dimensions the array, which is necessary to resetA()between games but also resetsSCOREto 0 automatically. - Colour attributes on PRINT: Inline
INK,PAPER,FLASH, andBRIGHTkeywords withinPRINTstatements are used throughout for context-sensitive highlighting without permanently changing the global attribute state (except where set by line 20).
Content
Source Code
10 REM FRENCH VOCABULARY
20 LET SCORE=0: PAPER 1: INK 7: BORDER 1: CLS
30 DIM A(20)
40 PRINT ''TAB 6;"Welcome to this French"
50 PRINT TAB 8;"vocabulary test."
60 PRINT ''TAB 6;"How many words would"
70 PRINT " you like to try? (1 to 20)"
80 INPUT B
90 IF B<1 OR B>20 THEN GO TO 80
100 FOR C=1 TO B
110 FOR D=1 TO INT (RND*20)+1
120 READ E$: READ F$: READ X
130 NEXT D
140 RESTORE : CLS
150 IF A(X)=1 THEN GO TO 110
160 LET A(X)=1
170 PRINT ''' INK RND*7; PAPER 9;" Question number ";C;": "
180 PRINT '''"What is the French word for";TAB 4;E$;"?"
190 INPUT A$
200 IF A$=F$ THEN LET SCORE=SCORE+1: BEEP .1,2.5*SCORE: PRINT FLASH 1; INK 2; PAPER 5;'''" Yes, ";F$;" is correct "
210 IF A$<>F$ THEN PRINT ''"No, I'm sorry."''"The French word for ";E$;TAB 6;"is ";F$
220 IF C<B THEN PRINT '' INK 3; FLASH 1; BRIGHT 1;" Your score is now ";SCORE;" "
230 PAUSE 150
240 NEXT C
250 INK 2: PAUSE 7: FLASH 1: CLS : PRINT AT 6,3;"In that test you scored ";SCORE
260 PAUSE 200: FLASH 0
270 RUN
280 DATA "EVERYWHERE","PARTOUT",1,"SELDOM","RAREMENT",2,"OFTEN","SOUVENT",3,"NEVER","JAMAIS",4,"ALWAYS","TOUJOURS",5
290 DATA "VERY","TRES",6,"MORE","PLUS",7,"LESS","MOINS",8,"YES","OUI",9,"NO","NON",10
300 DATA "THANK YOU","MERCI",11,"ONE","UN",12,"TWO","DEUX",13,"THREE","TROIS",14,"FOUR","QUATRE",15
9998 SAVE "FRENCH 1" LINE 1
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

