Spanish Builder II

This file is part of and CATS Library Tape 6. Download the collection to get this file.
Date: 198x
Type: Program
Platform(s): TS 2068

This program implements a two-way vocabulary quiz module, likely part of a larger language-learning system, testing either English-to-foreign or foreign-to-English translation. It uses parallel string arrays — `E$()` for English words and `F$()` for foreign-language words — along with a tracking array `C$()` that records already-tested items to prevent repeats within a round. The correct answer is displayed both as a single line and then animated across the screen using a `FOR`/`NEXT` loop printing at every other row in two columns, providing a brief reinforcement effect. The program saves itself with an auto-start entry point at line 85, suggesting it is part of a multi-module vocabulary builder suite.


Program Analysis

Program Structure

This listing is a self-contained quiz module, beginning at line 85 with setup and running through two main subroutines. It is designed to be called as part of a larger vocabulary builder, with word data (arrays E$(), F$(), and the count variable W) presumably loaded or defined elsewhere before line 85 is reached.

  1. Lines 85–140: Setup, mode selection, and round-completion logic
  2. Lines 700–820: Subroutine — English-to-foreign quiz (Test 1)
  3. Lines 900–1015: Subroutine — Foreign-to-English quiz (Test 2)
  4. Lines 9997–9998: Stop and SAVE

Quiz Logic and Repeat-Prevention

Both subroutines share the same anti-repeat mechanism. A counter Q tracks how many words have been tested in the current round, and C$() stores the words already used. Each time a random index R is chosen via INT (W*RND)+1, a FOR P=1 TO Q loop checks whether the chosen word already appears in C$(). If it does, the subroutine loops back to pick a new random index. This ensures every word in the vocabulary list is tested exactly once per round.

Answer Display and Reinforcement Effect

After each answer, the correct translation is shown once as a standard PRINT statement, then repeated across the screen using AT positioning. A FOR X=10 TO 20 STEP 2 loop prints the answer at rows 10, 12, 14, 16, 18, and 20, in two columns (positions 0 and 15), creating a tiled reinforcement display before the screen is cleared or paused.

Key Variables

VariablePurpose
WTotal number of vocabulary words (set externally)
E$()Array of English words
F$()Array of foreign-language words
L$Name of the foreign language (set externally, used in prompts)
QCount of words tested this round
C$()Array recording words already tested this round
RRandomly chosen word index
A$User’s typed answer (accepted but not evaluated)
CHUser’s mode choice (1 or 2)

Notable Techniques and Idioms

  • No answer grading: The user’s input A$ is collected but never compared against the correct answer. The program functions as a prompted self-check rather than a scored test.
  • Delay loop: Line 800 uses FOR D=1 TO 200: NEXT D as a busy-wait pause in Test 1. Test 2 uses PAUSE 90 instead — an inconsistency between the two subroutines.
  • PAUSE 0 / INKEY$ idiom: Line 127 uses PAUSE 0 followed by INKEY$ checks at lines 130–135 to wait for a keypress before deciding whether to repeat the round or proceed to save.
  • Restart via GO TO 90: Line 130 branches to line 90, which does not appear in this listing, implying it exists in an earlier portion of the full program that resets state for a new round.

Bugs and Anomalies

  • Lines 130 and 135 both use INKEY$ after PAUSE 0. Since PAUSE 0 waits for any key and then returns, INKEY$ will be empty by the time line 130 is evaluated, unless the key is still held. This is a common but unreliable pattern; the key may or may not still be depressed when line 135 is reached, making the “N” branch potentially unreachable in practice.
  • The C$() array is initialized to Q=0 at line 95 but the array itself is never explicitly dimensioned here, relying on prior setup code.
  • Line 135’s message instructs the user to “GOTO 9998,” which in context means the program will auto-save — but the PAUSE 360 and STOP at line 140 execute regardless of whether the user pressed “Y” or “N”, meaning a “N” response leads to an auto-save regardless after the delay.

Content

Appears On

Capital Area Timex Sinclair User Group’s Library Tape.

Related Products

Related Articles

Related Content

Image Gallery

Spanish Builder II

Source Code

   85 REM CHOOSE TEST
   86 BORDER 3: INK 0: PAPER 6
   95 LET Q=0: LET G=0
  100 PRINT "1)ENGLISH TO ";L$;"?"
  105 PRINT "2)";L$;" TO ENGLISH?"
  110 INPUT "CHOICE--1 OR 2?";CH
  115 IF CH=1 THEN GO SUB 700
  120 IF CH=2 THEN GO SUB 900
  125 PRINT "YOU HAVE COMPLETED A ROUND",," DO YOU WANT TO DO MORE?(Y/N)"
  127 PAUSE 0
  130 IF INKEY$="Y" THEN GO TO 90
  135 IF INKEY$<>"Y" THEN PRINT "AUTO SAVE WILL PRESERVE ENTERED VOCABULARY. GOTO 9998"
  140 PAUSE 360: STOP 
  700 REM TEST 1
  705 LET R=INT (W*RND)+1
  710 REM TO CHECK PREVIOUS ANSWERS
  715 FOR P=1 TO Q
  720 IF F$(R)=C$(P) THEN GO TO 705
  725 NEXT P
  730 CLS 
  735 PRINT "ENGLISH WORD: ";E$(R)
  740 INPUT "TRANSLATION? ";A$
  780 PRINT "THE MEANING OF ";E$(R),,"IS",,F$(R)
  783 FOR X=10 TO 20 STEP 2
  784 PRINT  AT X,0;F$(R): PRINT AT X,15;F$(R)
  785 NEXT X
  800 FOR D=1 TO 200: NEXT D
  801 CLS 
  805 LET Q=Q+1: LET C$(Q)=F$(R)
  810 IF Q=W THEN GO TO 820
  815 GO TO 700
  820 RETURN 
  900 REM TEST 2
  905 LET R=INT (W*RND)+1
  910 FOR P=1 TO Q
  915 IF E$(R)=C$(P) THEN GO TO 905
  920 NEXT P
  925 CLS 
  930 PRINT L$;" WORD: ";F$(R)
  935 PRINT "ENGLISH EQUIVALENT: "
  940 INPUT A$
  975 PRINT "THE MEANING OF",,F$(R),," IS ",,E$(R)
  976 FOR X=10 TO 20 STEP 2
  977 PRINT AT X,0;E$(R): PRINT AT X,15;E$(R)
  978 NEXT X
  980 PAUSE 90
 1000 LET Q=Q+1: LET C$(Q)=E$(R)
 1005 IF Q=W THEN GO TO 1015
 1010 GO TO 900
 1015 RETURN 
 9997 STOP 
 9998 SAVE "SPANBLDR2" LINE 85

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

People

No people associated with this content.

Scroll to Top