EasyManua.ls Logo

Radio Shack TRS-80 - Page 116

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...
30
INPUT
"DIAGONAL
LENGTH"
;K
40 CLS
50
FOR
L
=
TO K
60
SET
CX+L.Y+L)
70 NEXT L
99
GOTO 99
Once we have the
diagonal
line, we
can
form a right
triangle
by
adding:
70
SET(X,Y+L)
80
SET<X+L,Y+K>
9
NEXT L
or
70
SET(X+K
,
Y+L)
80
SET(X+L,Y)
90
NEXT
L
Try
them
both. What is the difference in the
displays?
Answer:
They
are inverted, mirror-images of each other.
Broken
Lines
In
every graphics program we have used, we could have
made
the lines "broken" by intro-
ducing
a
STEP
other
than
"1"
in the FOR-NEXT loops. For
example,
we can get a
broken
horizontal
line with:
114

Other manuals for Radio Shack TRS-80

Related product manuals