Spirograph

Author(s): Martin Richards
Publication: LISTing Newsletter
Date: May 1993
Pages: 6

SPIROGRAPH, from Martin Richards, of Stevenage, Herts uses the hi-res graphics of the Spectrum to fascinating effect.

The program produces graphics in the style of those line-drawing machines with the swinging weights and turning tables. On the Spectrum, too, it is fun to watch and you have good pictures.

  5 LET LX=0: LET LY=0
7 LET X=0; LET Y=0
10 CLS
20 INPUT "RADIUS OF OUTER RING?";R
25 IF R=0 THEN GO TO 10
30 INPUT "RADIUS OF WHEEL?";R1
40 INPUT "POSITION OF WHEEL?";D
50 INPUT "SPEED?";S
55 LET LX=127: LET LY=87+R-D
57 PLOT LX,LY
60 LET A=0
100 LET X=(R-R1)*SIN (A)+(R1-D)*SIN (A*-(R/R1-1))+127
110 LET Y=(R-R1)*COS (A)+COS (A*-(R/R1-1))*(R1-D)+87
120 DRAW X-LX,Y-LY
130 LET LX=X
140 LET LY=Y
150 LET A=A+S
160 IF INKEY$="" THEN GO TO 100
180 GO TO 20

SINCLAIR PROGRAMS November/December 1982

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.