EasyManuals Logo

Texas Instruments TI-99/4A User Reference Guide

Texas Instruments TI-99/4A
204 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
Page #172 background imageLoading...
Page #172 background image
Inchworm
This
program
creates
an
inchworm
that
moves
back
and
forth
across
the
screen.
When
the
inchworm
reaches
the
edge
of
the
screen,
an
"uh-oh"
sounds,
and
the
inchworm
turns
around
to go
in
the
opposite
direction.
.
l'hese
statements
allow you to
enter
a
color
for
the
inchworm
(color
codes
2·3,5-16
are
recommended).
The
screen
is
then
cleared.
The
CALL
COLOR
statement
assigns
the
color
you
selected
to
character
set
2.
XDIR
IS
used
to de,,'"ignate
which
directIOn
the
inchworm
moves
(+
1
indicates
right
and
-1
indicates
left).
This
loop
moves
the
inchworm
across
the
screen.
Line
180
computes
where
the
next
block
is
to
be
displayed
and
line
190
places
the
new
block
on
the
screen.
The
DELAY
luup g;uvcnas
how
fast
the
inchworm
moves
aCross
the
screen
Line
220
erases
the
old
color
block
(so a
continuous
line
won't
be
drawn)
by
placing
a
blank
space
over
the
block
previously
displayed
at
XULO.
Lme
2JU
saves
the
current
block
position
so a
new
one
can
then
be
computed.
The
loop
is
repeated
until
the
inchworm
reaches
the
edge
of
the
screen.
Line
250
reverses
the
direction
of
the
inchworm.
Lines
260
and
270
produce
the
"uh-oh"
sound.
Then
line 280
causes
the
loop to
be
performed
again.
III·16
Examples:
>N
EW
>'00
R~M
lNLHWORM
>110
CALL
CLEAR
>120
INPUT
"COLOR?
":C
>130
CALL
CLEAR
~140
CALL
COlDR(2,e,C)
>150
XOLO=l
>160
XDIR=1
>170
FOR
1=1
TO
31
>180
XNEW=XDLD+XDIR
>190
CALL
HCHAR(12,XNEW,42)
~2oo
FOR
DElAY='
TO
200
>210
NEXT
DELAY
>220
CALL
HCHAR(12,XOLO,32)
>230
XOLO=XtllEW
~240
NEXT
1
>250 XDIR=-XD1R
~260
CALL
SOUND<100,392,2)
>270
CALL
SOUNO(100,330,2)
>280
GoTo
170
>RUN
--screen
cLears
COLOR?
7
--screen
cLears
--inchworm
moves
back
and
forth
across
the
<creen
(press CLEAR
to
stolJ
the
IJrogram)
User's
Reference
Guide

Other manuals for Texas Instruments TI-99/4A

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Texas Instruments TI-99/4A and is the answer not in the manual?

Texas Instruments TI-99/4A Specifications

General IconGeneral
BrandTexas Instruments
ModelTI-99/4A
CategoryDesktop
LanguageEnglish

Related product manuals