[net.micro.6809] Super simple random colors in PMODE 4

mckay@princeton.UUCP (09/24/83)

	Even easier than Mike K.'s example of color on PMODE 4 is the
following:

10 PMODE 4:SCREEN 1,1:PCLS
20 PSET(RND(255),RND(191),RND(2)):GOTO 20

	This doesn't look like much at the start; just a sprinkling of red
and green dots. But, as more dots appear and they get closer together, you
will see blues and oranges and other colors appear.  A little more
interesting effect can be had with an array and a little more code like this:

 5 POKE 65495,0
10 PMODE 4:SCREEN 1,1:PCLS
20 DIM PAT(1024)
30 L=RND(1024):FOR I=0 TO L:PAT(I)=RND(2):NEXT I:P0=0
40 FOR Y=0 to 191:FOR X=0 to 255:PSET(X,Y,PAT(P0))
50 P0=P0+1:IF P0>L THEN P0=0
60 NEXT X,Y
70 GOTO 30

	This I refer to as my "rug weaver" program.  The repeating pattern
of pixels created in the array, looks like a repeating pattern of colors on
the PMODE 4 screen with color set 1.  The program will pause for a moment
while it generates a pattern and then plots it on the screen. When it
finishes ploting it repeats the process.  For those of you who don't know
this already the poke in line 5 will double the processor clock speed.  This
makes things go a lot faster at the expense of screwing up the sound
generator, tape and floppy disk I/O.  To slow the clock down again (so you
can save the program, etc.) use POKE 65494,0.  This is a VERY handy poke for
graphic routines and games in BASIC as it makes the speed a bit mor
tolerable.
	Happy coloring!
			--Dwight McKay
			...princeton!mckay