10DEFFNS="Pat2"
20 REM Program name "PATTERN"
30 REM Written by M.L.W. 4/6/1988
40 REM Article by Keith Devlin
50 REM Computer Guardian 2/6/1988
60 REM Sent to 8BIT SOFTWARE 16/2/94
70REM Fiddled with by CJR 21.2.94
80 MODE0
90VDU23;8202;0;0;0;
100N=1:D=1
110ONERROR
120PRINT'"Change the D and N values us
ing ZXCV."
130PRINT"Dump the screen (When finishe
d) by pressing D."
140PRINT"Pressing any other key cancel
s dump."
150PRINT'"ESCAPE to return here."'
160INPUT"Val 1? 1-359 RETURN=no change
. "D%:IF D%>0 IF D%<360 D=D%
170INPUT"Val 2? 1-359 RETURN=no change
. "N%:IF N%>0 IF N%<360 N=N%
180REPEAT
190REPEAT
200D%=0
210CLS
220PRINTTAB(0,0);STR$D;" Z-Down X-Up"'
STR$N;" C-Down V-Up"
230*FX21
240COLOUR 1
250VDU 19,1,RND(6),0,0,0
260oldX=0:oldY=0:A=0
270VDU 29,640;512;
280MOVE oldX,oldY
290REPEAT
300A=A+D
310IF A>360 A=A MOD 360
320X=((N*A)MOD360)*0.01745
330R=SIN(X)
340T=A*0.01745
350newX=R*SIN(T) :newY=R*COS(T)
360newX=500*newX :newY=500*newY
370DRAW newX,newY
380Z%=INKEY0
390IFZ% <>-1 PROCinput
400UNTIL A=360
410IF Z%=-1 OR Z%=68 VDU19,1,7,0,0,0:F
ORDEL=1TO1000:NEXT
420IF D%:OSCLI"GDUMP":REM YOUR DUMP RO
UTINE HERE
430IF Z%=-1 D=D+1
440UNTILD=360
450D=1
460IF Z%=-1 OR Z%=68 N=N+1
470UNTILN=360
480END
490DEFPROCinput
500IFZ%=68 D%=1 ELSE D%=0
510IFZ%=90 IF D>1 D=D-1
520IFZ%=88 IF D<358 D=D+1
530IFZ%=67 IF N>1 N=N-1
540IFZ%=86 IF N<358 N=N+1
550IF Z%<>68 A=360
560ENDPROC