Radio Shack TRS-80 Model 100 Basic Manual page 159

Basic language lab
Hide thumbs Also See for TRS-80 Model 100:
Table of Contents

Advertisement

The string variables A$, B$ and C$ will contain the characters for the first, second
and third windows respectively.
Lines 128·148 The characters are printed in the windows.
Line 158 The NEXT T statement defines the end of the wheel spinning loop begun in
line 70.
Line 168 If all three characters are the same, execution jumps to line 200, otherwise
execution continues with line 170.
Line 178 The prompt "PRESS ENTER" is displayed in the lower left comer of the
LCD.
Line 188 The keyhoard is scanned until a key is pressed.
Line 198 When a key is pressed, the prompt "PRESS ENTER" is erased and
execution transfers to line 20 to repeat the game.
Line
288
A "W I N" message and a siren are repeated four times.
Line 218 The word "W I N" is printed on the bottom of the slot machine.
Lines 228.238 This loop produces the siren sound by increasing the frequency in steps
of 50.
Line
248
The "W I N" message is erased so that it will appear to flash.
Line 258 A FOR / NEXT loop is used to create a short delay.
Line 268 The NEXT J statement defines the end of the "W I N" loop. At the end of
the loop, execution will transfer to line 170 which will print the prompt and wait for a
key to
be
pressed.
What you have learned:
You have leamed that BASIC programs may be enhanced through the addition of
sound, animation and simulation. The SOUND statement allows you to create a tone
with a specific pitch and duration. This can be used to generate many different
sounds. Motion on the display can be created in a variety of ways, including use of
the PRINT@ statement. The RND function lets you simulate events by generating a
sequence of random numbers.
153

Advertisement

Table of Contents
loading

Table of Contents