EasyManua.ls Logo

Apple IIe - Page 229

Apple IIe
320 pages
Print Icon
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...
10
DIM
A(12)
20
FOR I = 1
TO
12
30
A(I) =
30
* RND(1)
40
NEXT
I
50
GR:HOME
Apple
lie
Graphics
229
60
PRINT
"MONTH:
1
FM
AM
J J
AS
0
ND"
70
FOR
I=
1TO12
80
COLOR=
I
90
VLIN A(l),39 AT 5 + 2 * 1
100
NEXT
I
Lines 10-40
initialize
the
array A
with
random
values. Line
50
clears
the
entire
screen. Line
60
prints
the
headings
on
the
column.
Lines 70-100
plot
the
bar charts.
Writing a Game Program
In this
section,
the
game,
"BARACADE"
will
be
designed
. The
object
of
the
game
is
to
avoid
the
baracades
as
well
as
your
own
trail. The game
will
be
written
in
BASIC
so
that
it
may be easily
modified
.
If
the
reader does
not
wish
to
follow
the
step-by-step
designing
of
BARACADE, he may page
through
the
chapter
.
All
program
lines may easily be
distinguished
from
the
rest
of
the
text. To play
BARACADE,
merely
enter
every
line
belonging
to
the
program
.
The first step
in
designing
"BARACADE"
is
to
program
the
com-
puter
to
draw
a trail. The
following
statements accomplish this.
10
GR:
HOME
140
Y =
20
: X =
20
: A =
65
150
COLOR
=4
155
GET
A$
160
IF
PEEK(-16384) > 127THEN
GET
A$ : A =ASC(A$)
170
IFA=8THENX=X-1
180
IF
A=
21
THEN X =
X+1
190
IFA=65THENY=Y-1
200
IF
A=
90
THEN Y =
Y+1
220
PLOT
X,Y
250
GOTO
160

Other manuals for Apple IIe

Related product manuals