EasyManua.ls Logo

Commodore Plus 4 - Page 106

Commodore Plus 4
234 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...
50
FOR
L =
0
TO
359
STEP
A
60
BOX
1,
100,
30,
220,
130,
L
70
NEXT
L
80FORL-1
TO
2000:
NEXT
L
90
GRAPHIC
0,1
5
TRAP
60
10
GRAPHIC
2,1
20DEFFNA(X)=--
INT(RND(1)'
X)
30
COLOR
1,
FNA(15)
+
1
40
BOX
1,
FNA(320).
FNA(160),
FNA(320),
FNA(160),,
1
50
GOTO
30
60
COLOR
1,2,3:
GRAPHIC
0
Hi;
return
and
type
RUN
after
each
program
is
completely
en
tered
Hold
down
the
STOP
key
to
end
the
program.
The
second
program
draws
different
colored
squares
all
over
the
screen.
You'll
notice
some
parts
of
the
screen
changing
when
other
parts
near
them
change.
The
reason
for
this
was
discussed
earlier
in
this
chapter.
Drawing
Your
Plus'4
also
has
commands
(or
drawing
circles.
Like
the
BOX
Circles
C0!r'mand.
we
can
vary
tne
shape
of
the
circle
to
form
an
oval
(also
called
an
ellipse),
and
we
can
rotate
the
oval.
We
can
also
just
draw
a
section
of
the
shape
(called
an
arc)
This
command
draws
a
circle
in
the
center
of
the
screen:
CIRCLE
1.160,100.50.
This
tells
the
Plus/4
to
draw
a
circle
with
its
center
at
row
160
and
column
100, with
a
radius
of
50.
This
actually
produces
an
oval,
since
the
dots
on
the
screen
are
taller
than they
are
wide.
To
change
this to
a
real
circle
you
must
add
a
separate
number
to
tell
that
the
height
is
different
from
the
width,
like
this
CIRCLE
1.160.100,50,42
The
Plus/4
can
also
draw
a
square,
triangle
or
other
polygon
using
the
CIRCLE
command.
Just
tell
the
computer
how
many
degrees
to
go
between
points
on
the
circle,
like this
CIRCLE
1.160.100,50.42....120
This
command
draws
a
triangle,
since
each
side
is
120
degrees
(Omitting
number
values
while
including
commas
in
a
graphic
com
mand
causes
the
computer
to
read
standard
default
values
for
the
missing
number.)
A
simple
formula
to
get
the
angle
for
a
polygon
with
N
sides
is
360/N.
Here's
a
quick
program
for
drawing
polygons

Other manuals for Commodore Plus 4

Related product manuals