EasyManua.ls Logo

Commodore Plus 4 - Page 169

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...
PEEK(X)
This
function
gives
the
contents
of
memory
location
X,
where
X
is
located
in
the
range
of
0
to
65535,
returning
a
result
from 0
to
255.
This
is
often
used
in
conjunction
with
the
POKE
slatement.
RCLR(N)
Returns
current color
assigned
to
source
N
(0
<
N
<
4}
(0=
background,
1
=
foreground,
2
=
multicolor
1,3=
multicolor
2,4
=
border).
RDOT(N)
Returns
information
about
the current
position
of
the
pixel
cursor
(PC)
at
XPOS/YPOS.
N
- 0
for
XPOS
1
for
YPOS
2
color
source
RGR(X)
Returns
current
graphic
mode
(X
is
a
dummy
argument).
RLUM(N)
Returns
current
luminance
level
assigned
to
source
N
RND{X)
(random
number)
This
function
returns
a
random number
between
0
and
1.
This
is
useful
in
games,
to
simulate
dice
rolls
and
other
elements
of
chance,
and
is
also
used
in
some
statistical
applications.
The
first
random
number
should
be
generated
by
the
formula
RND(-TI),
to
start
things
off dif
ferently
every
time. After
(his,
the
number
in
X
should
be
a
1,
or
any
positive
number.
{X
represents
the
seed,
or
what
the
RaNDom
number
is
based
on.)
If
X
is
zero,
RND
is
re-seeded
from
the
hardware
clock
every
time
RND
is
used-
A
negative
value
for
X
seeds
the
random
number
generator
using
X
and
gives
a
random
number
sequence.
The
use
of
the
same
negative
number
for
X
as
a
seed
results
in
the
same
sequence
of
random
numbers.
A
positive
value gives
random numbers
based
on
the
previous
seed.
To
simulate
the
rolling
of
a
die,
use
the
formula
INT{RND(1)*6+1).
First
the
random
number
from
0-1
is
multiplied
by
6,
which
expands
the
range
to
0-6
(actually,
greater
than
zero
and
less
then
six).
Then
1
is
added, making
the
range
1
to
under
7.
The
INT
function
chops
off
all
the
decimal
places,
leaving the
result
as
a
digit
from
1
to
6.
To
simulate
2
dice,
add
two
of
the
numbers
obtained
by
the
above
for
mula
together.
160
^^^^^^^^^^^^^^^^^™

Other manuals for Commodore Plus 4

Related product manuals