Spanish Builder I

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 is a two-way vocabulary quiz that tests the user on word pairs stored in parallel string arrays, supporting both English-to-foreign and foreign-to-English directions. The language name is held in the variable `L$`, and word pairs are stored in `E$()` (English) and `F$()` (foreign), with `W` holding the total word count — all presumably initialized in an earlier, not-listed portion of the program. A previously-answered-word tracking mechanism uses array `C$()` and counter `Q` to prevent repeating questions within a single round. Correct answers are displayed in a decorative tiled pattern using nested `FOR` loops with `PRINT AT` across multiple screen positions. The program auto-saves itself with `SAVE “SPANBLDR1” LINE 85` to preserve the vocabulary data between sessions.


Program Analysis

Program Structure

This listing is a fragment of a larger vocabulary-building program (the name “SPANBLDR1” in the SAVE command suggests a Spanish vocabulary builder). Lines before 86 are not shown but presumably handle initialization of L$, E$(), F$(), W, and C$(). The visible code divides into three logical blocks:

  1. Lines 86–135: Main menu and round control loop
  2. Lines 700–820: Subroutine — English-to-foreign quiz
  3. Lines 900–1015: Subroutine — Foreign-to-English quiz

Variable Usage

VariablePurpose
L$Name of the target language (e.g., “SPANISH”)
E$()Array of English words
F$()Array of foreign-language words
WTotal number of word pairs
QCount of words answered in the current round
C$()Array recording already-used words to prevent repeats
RRandomly selected word index
CHUser’s menu choice (1 or 2)
A$User’s input answer (collected but not evaluated)

Anti-Repeat Mechanism

Both quiz subroutines use a linear scan of the C$() array to ensure that a randomly selected word has not already been tested in the current round. In subroutine 700 (lines 715–725), if F$(R) matches any previously stored C$(P), a new random index is chosen by jumping back to line 705. The same logic appears at lines 910–920 in subroutine 900, checking E$(R) against C$(P). This is a simple but effective guard against repetition, though it could loop indefinitely if W is small and all words have been used — a condition that should not occur because the round ends when Q=W.

Answer Display — Tiled Pattern

After revealing the correct answer, both subroutines display the answer word tiled across the screen using nested FOR loops (lines 783–785 and 976–978). The outer loop steps Y from 0 to 30 in steps of 12 (columns), and the inner loop steps X from 10 to 20 in steps of 2 (rows), printing the word at each intersection with PRINT AT X,Y. This creates a decorative grid of repeated correct answers as visual reinforcement.

Bugs and Anomalies

  • Answer is never checked: In both subroutines, the user’s input is stored in A$ but is never compared to the correct answer. The program always reveals the correct answer unconditionally. There is no right/wrong feedback, score tracking, or differentiation between correct and incorrect responses.
  • Subroutine 900 never increments Q or stores to C$() via its own path: Lines 1000–1015 handle the Q increment and C$(Q) assignment for Test 2, but line 986 jumps directly back to line 900 (GO TO 900) without passing through line 1000. This means Q is never incremented in the foreign-to-English test, and the round-complete condition Q=W at line 1005 is never reached. The Test 2 subroutine effectively loops forever and never returns.
  • Line 130 / 135 keypress logic: PAUSE 0 at line 127 waits for any key, but lines 130 and 135 then read INKEY$ in sequential statements. Since PAUSE 0 resumes on any keypress and the key may no longer be held, the INKEY$ reads at 130 and 135 may both return empty string, causing neither branch to execute and the program to fall through to the STOP at line 9997.
  • Line 135 prints 240 as a literal number: PRINT 240 outputs the numeric value 240, which appears to be a mistake — likely intended to be a string message or a line reference that was incorrectly coded.
  • Line 130 references GO TO 90 but the listing begins at line 86, suggesting line 90 exists in the unlisted initialization section.

Key BASIC Idioms

  • Delay loop via FOR D=1 TO 200: NEXT D at line 800 — a busy-wait timing technique.
  • PAUSE 90 at line 980 provides a fixed ~1.6-second pause before continuing.
  • INT (W*RND)+1 produces a random integer in the range 1 to W, the standard idiom for selecting a random array index.

Content

Appears On

Capital Area Timex Sinclair User Group’s Library Tape.

Related Products

Related Articles

Related Content

Image Gallery

Spanish Builder I

Source Code

   86 BORDER 3: INK 0: PAPER 6
   92 CLS 
   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 VOCABULARY": PRINT 240: GO TO 1020 
  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  Y=0 TO 30 STEP 12: FOR X=10 TO 20 STEP 2
  784 PRINT AT X,Y;F$(R);
  785 NEXT X: NEXT Y
  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 Y=0 TO 30 STEP 12: FOR X=10 TO 20 STEP 2
  977 PRINT AT X,Y;E$(R)
  978 NEXT X: NEXT Y
  980 PAUSE 90
  986 GO TO 900
 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 "SPANBLDR1" 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