Commodore VIC-20 User Manual page 48

Hide thumbs Also See for VIC-20:
Table of Contents

Advertisement

1
L = INT(RND(1)*500)
2 C = INT{RND(1)*8) + 1
Read about
these in
Chapter 7.
3
POKE 7680 + U 160
Generates a
random number from 1
through 500.
Random number
from 1 through 8
c
c
<
<
c
c
c
(
Where is
this location?
4 POKE 38400 +Lt C
5
GOTO 1
Check Ihe example to see if all ttie lines were typed as
shown. If they are all right, clear the screen and type
|_Rj (JJJ |_
of color.
. Your screen should explode in tiny bursts
The VIC has done it again! With only a few keystrokes, it is
now dabbling color everywhere. How is this being done?
In simple terms, lines 1 and 2 are randomly selecting where
on the screen the coJor will go (L for Location maybe) and
what color (C for, of course. Color). Line 1 generates a
number from 1 through 500. Line 2 generates a number from
1 through 8.
c
c
c
<
<
c
<
(
I
c
c
c
c
38

Advertisement

Table of Contents
loading

Table of Contents