ARCHIMEDES VISUALS

We bring you another set of visually interesting routines accomplished with the minimum of code.

PATTERN GENERATOR

by L. Trail

This program generates an infinite number of coloured patterns. Each is based on a circle shape (see figure), and every second or so the circle is swept about the centre with two sets ellipses. Each sweep is of random colour and plotting mode, thus building up an infinite variety of patterns. The program may be frozen by pressing the space bar. Pressing any other key will release it. Similarly, holding down any key apart from the space bar will speed it up.

Listing 1

10 REM >PattrnGen2
20 REM Pattern Generator
30 REM by L. Trail
40 :
50 MODE 15:OFF
60 G=RND(-TIME)
70 ORIGIN 640,512
80 GCOL 185:CLG
90 VDU 19,0,24,240,240,128
100 :
110 REPEAT
120 Z%=RND(100)
130 M%=450
140 FOR E=11.25 TO 180 STEP 11.25
150 ELLIPSE FILL 0,0,Z%,M%,RAD(E)
160 NEXT
170 Z%=RND(100):M% = 250
180 FOR E=22.5 TO 180 STEP 22.5
190 ELLIPSE FILL 0,0,Z%,M%,RAD(E)
200 NEXT
210 GCOL RND(7),RND(64) TINT RND(4)
220 T=INKEY(100):*FX15
230 IF T=32 REPEAT UNTIL GET<>32
240 UNTIL FALSE
250 END

PALETTE-CHANGE EFFECTS

by Barry Christie

The programs in listings 2 and 3 make use of a continuously changing palette to create hypnotic and extremely smoothly moving effects. Listing 2 gives a five-centred whirlpool in blue, while listing 3 creates a moving arrow-head effect.

Listing 2

10 REM >Whirls1
20 REM Moving Whirlpools
30 REM by Barry Christie
40 :
50 MODE 12
60 FOR I%=205 TO 0 STEP -1
70 GCOL I% MOD 16
80 CIRCLE FILL 320,256,I%*2
90 CIRCLE FILL 960,256,I%*2
100 CIRCLE FILL 320,768,I%*2
110 CIRCLE FILL 960,768,I%*2
120 CIRCLE FILL 640,512,I%*2
130 NEXT
140 REPEAT
150 FOR I%=0 TO 15
160 WAIT
170 FOR J%=1 TO 7
180 COLOUR I%+J%,0,0,J%*16
190 COLOUR I%+16-J%,0,0,J%*16
200 NEXT:NEXT:UNTIL FALSE
210 END

Listing 3

10 REM >Arrows1
20 REM Hypnotic Steel Arrows
30 REM by Barry Christie
40 :
50 MODE 12
60 FOR I%=446 TO 0 STEP -1
70 GCOL I% MOD 16
80 PLOT 4,0,512+I%*4
90 PLOT 4,I%*4,512
100 PLOT 117,0,512-I%*4
110 NEXT
120 REPEAT
130 FOR I%=0 TO 15
140 WAIT
150 FOR J%=1 TO 7
160 COLOUR I%+ J%,J%*16,J%*16,J%*16
170 COLOUR I%+16-J%,J%*16,J%*16,J%*16
180 NEXT:NEXT:UNTIL FALSE
190 END

MOUSE DRIVEN COLOURED DISCS

by Jeroen Boomgaardt
and Frits Steenmeijer

The program in listing 4 is similar to one published in RISC User Issue 2. It uses the mouse to paint with randomly coloured discs. Use select to draw, menu to increase the disc size, and adjust to reduce it. The latter two buttons when pressed simultaneously, clear the screen, while pressing all three quits the program.

Listing 4

10 REM >Circles2
20 REM Mouse driven disc effects
30 REM by Jeroen Boomgaardt
40 REM and Frits Steenmeijer
50 :
60 MODE 15:OFF
70 R%=75:*POINTER
80 REPEAT:REPEAT
90 MOUSE X%,Y%,B%
100 UNTIL B%<>0
110 GCOL RND(63) TINT 64*RND(4)
120 IF B% AND 4 WAIT:CIRCLE FILL X%,Y%,R%
130 IF (B% AND 2)AND R%<1000 R%+=2
140 IF (B% AND 1)AND R%>1 R%-=2
150 IF B%=3 CLS
160 UNTIL B%=7:ON
170 END