Download Print this page

Atari CX70 Operator's Manual page 44

Light pen

Advertisement

ATARI Light Pen Operator's Manual
Figure 17
Television Screen Display for Programming Example 4
The program utill ask you how many digits to use for an arithmetic
problem. Then it will display a pair of numbers* each with the
selected number of digits* as an addition problem. There are ten
choices of answers to this problem but only one of the answers is
correct.
Use the pen to point to the correct answer. If you select the wrong
one* the computer will tell you it is not correct. When you point to
the correct answer* a new problem will be presented.
By examining the program listing*
you will notice that the light pen
is used as an input for two separate parts of the program* once at
lines 50-60 and again at lines 250-260.
Initial setup takes place in lines 20-50. It establishes colors* sets
the number of median reads to 15*
and
turns off the cursor.
The
initial read of the light pen registers requires that the Y value be a
12. This means you are pointing to one of the characters in the row
representing how many digits are to be used for the test. This is done
by line 80.
Lines 100-140 calculate and print the digits for the arithmetic
problem. There will be 10 possible answers to the problem. Line 150
selects which of the 10 positions will be occHjpied by the correct
answer. A random number is selected for each of the 10 positions*
but line 170 bypasses the random number and places the correct
answer
there
instead.
Line 200 prints each answer in inverse video (with dark characters on
a bright background) so that the pen will be able to respond to the
A Teaching Aid - 40

Advertisement

loading