Classic Computer Magazine Archive ANTIC VOL. 7, NO. 10 / FEBRUARY 1989

Type-In Software


Spelling Flashcards

Friendly quiz that kids like using.

By Andy Barton

Spelling Flashcards is a simple, versatile spelling quizzer for all ages. It's enjoyable for kids, without intimidating them by excessive flash. This BASIC Program works on all Atari 8-bit computers with at least 48K memory and a disk drive.

Spelling Flashcards is simple, versatile spelling drill for all ages. Like Math Flashcards, the predecessor program I wrote (Antic, October 1987), this spelling quizzer program is friendly and interesting with a little color and music. But it doesn't distract or intimidate kids with unduly flashy displays.

You easily create your own lists of hard-to-spell words. Then Spelling Flashcards will randomly pick a word and flash it on the screen.

If you spell the word correctly you're rewarded with an ever-changing little tune. Otherwise, the screen turns red, the word flashes again, incorrect letters are blanked out and you get to try again. After you type the word correctly that word will be repeated three more times during the quiz to help you get it down perfectly.

Speed is important, too. If you take too long to spell a word, the program considers it incorrect. At the end of the quiz, Spelling Flashcards shows you the number of correctly spelled words and the total number of words tried.


If you put Spelling Flashcards on a separate disk, its menu will be easier to read. Format a fresh disk with DOS 2.0 or DOS 2.5 and write the DOS files to it. Type in Listing 1, SPELLING.BAS, check it with TYPO II and SAVE a copy before you RUN it.

If you have trouble typing the special characters in lines 5860-5870, don't type them in. Instead, type Listing 2, check it with TYPO II and SAVE a copy. When you RUN Listing 2, it creates these hard-to-type lines and stores them in a file called LINES.LST. To merge the two programs, LOAD "D:SPELLING.BAS" and then ENTER "D:LINES.LST." Remember to SAVE the completed program before you RUN it.

When RUN, the program displays a file menu of all the Spelling Flashcard lists on your disk. The menu at the bottom of the screen lets you load one or more Spelling Flashcards lists, edit a list, or create a new list.

Type a list's number to load it into Spelling Flashcards. You can choose a single number, several numbers seperated by commas or two numbers separated by a hypen, indicating a block of files. For example, type a 3 to load list number 3. Type 3,5,9 to load lists 3, 5 and 9. Type 5-8 to load lists 5, 6, 7 and 8.

Edit a list by typing E followed by the number of the list you wish to edit. For example, typing E7 will let you edit list number 7. Finally, type N to create a new list of spelling words.


If you're typing-in SPELLING.BAS, you'll need to create a few lists before you continue. Antic Disk owners will find several spelling lists on this month's disk. These lists have a .DAT file extender.

To begin your list type N. The program will ask you for a title of your list. The title can be up to 8 characters long, and will be used to store your list to a disk file. While you may type most anything you wish, the program will adjust it to conform to a standard Atari disk filename, and add a .DAT extender.

Spelling Flashcards will display thq adjusted filename and ask you if it is correct. Press N to change the filename, or press any other key to accept it. Pressing [RETURN] without typing a title sends you back to the main menu without creating any new lists.

Next you're asked to select the number of seconds you wish the word to be flashed on the screen. The default is 0.75, but younger children might find one or two seconds more reasonable and less threatening. You can also change this value later in the Edit mode, if you wish.

Now type in your list. Each word can be as many as 15 characters long, including hyphens, apostrophes, and spaces. Numbers and lowercase letters are not allowed. You may have up to 40 words per list. When you're done, press [RETURN] to save your list to disk.


After the program loads the list(s) you selected, you'll see the words displayed on screen for you to review. Press any key to start the drill.

Spelling Flashcards randomly selects a listed word and briefly flashes it onscreen. Your task is to type it in. The [DELETE] and arrow keys will fix any typing mistakes you make. After you spell the word, the program will check it. There is no need to press [RETURN].

Correctly spelled words are rewarded with a brief ever-changing tune. Misspelled words turn the screen red and must be corrected. They are repeated three times on orange screens, mixed in with new words.

If you are totally stuck, press [RETURN] to flash the word on screen again. This counts as a misspelling. If you do not type the word quickly enough, you'll also be penalized for a misspelling.

Errors are not monitored directly, but the number of tries and the number of correct answers are counted. The purpose of the drill is to teach, not penalize.

When you're done, Spelling Flashcards plays a longer random tune. Press any key to go on to your next list or return to the main menu.


The New List and Edit options share a section of programming. Adding, correcting and deleting words is done the same way. When a key is pressed, a Graphics 2 window opens in the middle of the screen. You'll enter and edit words within this window.

To add a word simply type it. To idit a word, type the number of the word in the list displayed on screen, then edit the word. You don't need to press [RETURN], but the second digit of a two-digit number must be pressed within 0.5 seconds.

The [DELETE] and [CONTROL]-[DELETE] keys work in the normal Atari fashion. Move the cursor (a blue bar below the letters) with the left and right arrow keys. You do not need to press [CONTROL] to use these keys.

Press [RETURN] to accept the word and display the updated list. To delete a word, simply bring it into the window by typing its number, [DELETE] or [SPACEBAR] over each letter and press [RETURN]. When you are finished with a list, press [RETURN] to save it to disk and return to the main menu.


Spelling Flashcards is written up-side down, with the initialization routines and lesser-used portions at the end of the program. The frequently used subroutines are at the top, where BASIC can find them quickly.

Lines 5500-5570. The initialization section starts with a table of parameters which you can customize. DVIEW in line 5550 is the default value for the length of time a word is flashed on the screen. You can experiment with different values when you enter or edit a list. If you want the timer to use a different default value, put it in line 5550. If you change line 5550, remember to SAVE the program to make the change permanent.

Lines 5860-5870 contain a speedy machine language "memory move" routine, a modified version of a USR routine from Antic Tech Tips January 1985, page 64). Here, I use it to copy the character set from ROM to RAM, where it is redefined at line 5900.

Lines 4500-5020: reads and displays the disk menu. See Antic Tech Tips, July 1986, page 87.

The main menu, as well as word lists, are displayed in the largest graphics mode possible. The program uses Graphics 2 if the list is 10 words or less and Graphics 1 if it is 20 or less. Larger lists use Graphics 0. Lines 4600 and 3130 do this with a little Boolean math. In one line, this routine does the same work as three or four lines of IF-THEN statements. (See Antic, August 1984, pages 48-52.)

Line 3230-3360. The main loop of the program is short, but uses subroutines extensively. And many of these subroutines call other subroutines. The result is a compact, easy-to-type program.

Within this loop, the matrix TRACK(X,X) keeps track of the status of the words in your list. It has two rows. Row (0,X) contains a random series of numbers. Each number corresponds to a word in the spelling list. The program uses this information to build its random list of words.

Row (1,X) records how many more times a misspelled word must be repeated. TRACK(1,0) is a flag which directs the main loop to the proper combination of subroutines for either the basic drill or the misspelled drill.

Lines 110-140. The first subroutine is a timer. It is short, clean and accurate. Probably most every other programmer knows about it. But I just recently stumbled upon it in a article I read but forgot years ago (Antic, March 1984, pages 19-21). If you're not familiar with Atari's built-in count-down timers, take a second to check them out.

A countdown timer is a system timer that counts backwards and uses jifftes (60 jiffies = one second) instead of seconds. This program uses CDTMV3, system timer 3. Here's how to use countdown timers:

1. Determine the length of time you need to monitor, and convert this value into jiffies. Five seconds, for example, is equal to 300 jiffies.

2. Separate this value into low-bytes and high-bytes. The low and high-byte values of 300, for example, are 44 and 1.

3. Temporarily turn off the clock by placing a 1 (or any non-zero value) into CRITIC, the critical I/O region flag (memory location 66, $42).

4. Set the timer by placing your low and high-byte values into the countdown timer register. In this example, we're using countdown timer 3, CDTMV3, which is accessed through memory locations 540 and 541 ($021C and $021D).

5. POKE a zero into CRITIC to turn the clock back on and start counting.

6. Monitor countdown timer flag 3, CDTMF3, memory location 554 ($022A). When PEEK(554)= 1, time is up! See line 3880 where the program is waiting for either a key to be pressed or the timer to run out before it moves on.

Here's one last item you may wish to customize. I hate pressing [RETURN] if it is not absolutely necessary. This program was designed with that bias in mind. However this poses a problem when you could choose to enter a 1 or 2 digit number. This happens in the Edit section of the program when you could choose edit word 1 or word 15.

Problem: How is the program going to know when you are through if you don't press [RETURN]? Solution: set a brief time limit for entering the second digit. Line 3870 does this: SEC=0.5:GOSUB 110 sets the timer for half a second. If this is too short, you can increase the 0.5 to a larger number. Again, remember to SAVE the program if you want to make the changes permanent.

Andy Barton has been a frequent Antic contributor since 1984. To his credit are such programs as Son Of InfoBits and TYPO II, Antic's type-in listing proof-reader. TYPO II has appeared in every issue since January 1985.

Listing 1: SPELLING.BAS Download

Listing 2: SPELLING.M65 Download / View

Data file: SAMPLE1.DAT Download

Data file: SAMPLE2.DAT Download

Data file: SAMPLE9.DAT Download