EasyManua.ls Logo

Radio Shack TRS-80 - Page 154

Radio Shack TRS-80
236 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Replace
the old line
40
with
40
IF
<
{
INT(X/16>*
16-X)=0)+< C
INT( Y/6)*6-Y)=0)
THEN
60.
and you
will
create
an
elaborate
eight-by-eight
checkerboard.
And
on and
on
it goes . . .
And
In
Conclusion
The
illogic
of
logical
math is
worth the
hassle.
As one last
fun program,
enter
and RUN this
"Midnight
Inspection."
Line
100
checks
each
response
for a NO
answer
(instead of a
YES).
Using
logical OR,
it
branches to
the "no-go"
statement
(line
130)
if any
one
of
the tests
does not
match the
expectation.
10
CLS
20 Y=l
:N=0
30 P.
"ANSWER
THESE
QUESTIONS
WITH *YES'
OR 'NO'."
sP.
40
IN. "HAS
THE CAT
BEEN PUT
OUT" ;A
50 IN.
"IS THE
PORCH
LIGHT
TURNED
OFF" ;B
60 IN.
"ARE ALL
DOORS AND
WINDOWS LOCKED" ;C
70
IN. "IS
THE
TELEVISION
TURNED
OFF"
jD
80 IN. "DID
YOU TURN
THE
THERMOSTAT
DOWN" ;E
90 P . s
P.
100
IF (
A=N)+(B=N)+(C=N)+(D=N)+(E=N)
THEN 130
120 P."
GOODNIGHT"
sEND
130 P.
"
SOMETHING HAS
NOT BEEN DONE.
DO
NOT GO
TO BED"
140 P.
"UNTIL
YOU FIND
THE
PROBLEM!"
150 GOTO 40
§
s
152

Other manuals for Radio Shack TRS-80

Related product manuals