THE END OF ODD MAN
Scoring and reward routines wrap it up
"The End of Odd Man" is the forth installment in a series designed to teach the basics of writing educational software. The basis ofthe series is a program called Odd Man Out. Portions of the program appeared in the December 1983 and January 1984 Issues Of ANTIC. The final portion of the program, to be merged with the previous parts, is contained in Listing 1 at the end of this article. Listing 2, therefore, is not a complete program, and will not run on its own. The RAM requirements of the completed program are 24K (cassette) or 32K (disk). -ANTIC ED
In the "Odd Man" series, we've discussed a number of techniques that can be used to improve the quality of user-written educational software. This month we'll conclude our discussion of this topic, and the program Odd Man Out, by covering the remainder of the program and recapping some of the highlights of the series, which began in the November 1983 issue.
THE MAKING OF ODD MAN
So far we've presented, in bits and pieces, a program designed to develop visual discrimination skills in preschool children. If we add scoring and reward routines to the portions of the program that have already appeared, Odd Man Out will be complete. Let's take a look at how this can be done.
Last month, we introduced Odd Man's joystick-movement and answer-select routine (lines 2500-2840). If we now add lines 2860-3080 (see Listing 1), the program will be able to determine if the correct shape has been selected, and to display a "happy" or "sad" face in response. In addition, the program will now keep track of the number of incorrect answers; this number is used in the reward routine.
Because the happy and sad faces are redefined characters, some additional work is required to enter the new character values. This is accomplished in lines 160, 600, 1360 and 4500 - 4600 of Listing 1. We've used the same techniques developed in "Odd Man Reforms" (ANTIC, December, 1983) to draw, define and store the values for these new characters.
REWARDING A JOB WELL DONE
If a child is going to play Odd Man Out more than once, the game must give the child a sense of accomplishment. Parental praise is the child's most important reward, of course, but it neverhurts to have the Atari computer offer a few kind words. Because of this, we designed a simple reward routine that incorporates the child's name. The computer clears the screen and then prints:
Three stars appear on the screen above the child's name if he or she has answered at least eight questions correctly. If nine answers are correct, a series of small dots explode in a display of Atari fireworks. A perfect score causes this display to flash and a siren to sound. The child simply presses the fire button to return to the menu after the reward sequence has been completed.
The reward routine is contained in lines 3100-4120. This segment of the program takes advantage of the fact that standard Atari characters are stored in the same manner as those we have created for Odd Man Out. It appears that the reward sequence mixes graphics and text on the screen, but we actually used the Graphics 5 mode to "draw" the letters used in the display.
The subroutine in lines 3760-3920 is used to display the text stored in DISP$. By determining the X and Y coordinates (PXO,PYO), the text can be centered on the screen. Next, each letter in the reward message is broken down into a series of numbers that describe the bit map of the character. This allows it to be plotted on the screen. The characters are originally drawn in one color. Different color registers are then used to generate the reward display's pulsating effect.
TRACKING A CHILD'S PROGRESS
One of our goals for Odd Man Out was to make it possible to monitor a child's progress in playing the game. As a result, we've provided a simple, yet effective, monitoring system as part of the program. Lines 700-760 open RECORD.DAT, the file that is used to store data concerning a child's progress. Lines 4060-4080 write this information to disk after each complete game. This occurs without the child's knowledge, and is thus not a distraction as he or she plays (and learns). The monitoring program is contained in Listing 2. To review your child's progress, type RUN "D:MONITOR. BAS". The program will read the data from the disk and display it for you. You are given the option to delete this data after you've examined it.
This concludes our series on Odd Man and the writing of educational software for preschool children. Listing 1 contains new code that needs to be added to the program listings that were published in the December and January issues. If you've been entering the various parts of the program as the Odd Man series has developed, you need only enter Listing 1 to complete the program. (The January installment explains how to merge the December and January segments of the listing.)
Now let's look back on what we set out to accomplish with the Odd Man series and how these goals were met.
In "Odd Man Out" (ANTIC, November 1983), we discussed the process of selecting an educational topic that is appropriate for the Atari computer to handle. Not every educational topic can, or should, be presented in this way; you shouldn't try to do the impossible. You should be imaginative, however.
Once you've selected a topic, you need to set specific objectives and stick to them. Programs of limited and well-defined scope are the easiest ones to write and use.
Your first step is to decide what kind of educational software you want to develop. Do you want to create a drill-and-practice program, a tutorial, a simulation, or a combination of these choices? Then, when you've finished the program, write a detailed description of what it does, and how it does it. Otherwise, you'll find yourself looking at the code six months later and wondering how and why the program was written.
In "Odd Man Reforms" (ANTIC, December 1983), we described a specific technique that we have found to be useful in the writing of educational software. The Atari computer has the ability to easily redefine character sets. This reduces the burden that is usually encountered by programmers who want to display figures on the screen. Since we used this technique extensively in Odd Man Out, we put a great deal of thought into the assignment of locations for redefined characters within the Atari character set. We wanted to ensure that the standard numerals and letters would be available as required and that they would not require any additional manipulations.
Last month, in "Odd Man At Play," we discussed simple character animation. We used this technique to add some game elements to the program to increase its level of interest for young children. In this application, the flexibility of the Atari character set was again evident.
This month's installment ties up the loose ends and concludes the listings for Odd Man Out. We hope that the techniques we've discussed will be useful to you in your own endeavors. Perhaps they'll even provide you with a starting point for that educational program you've been planning to write, but didn't know how to approach. Finally, we hope that those of you with young children will find that Odd Man Out is a worth while and challenging educational program, and that it will help your children develop their visual discrimination skills.
John and Mary Harrison are parents, teachers and Atari hobbyists. Mary teaches math ann computer science at the high school level. John holds an M .S. in computer science and develops educational software. They coordinate the Education Department for ANTIC.