1 ' Spirograph
2 ' by Andrew Smith 3 ' Amstrad Action May 87 10 MODE 1:INK 0,0:INK 1,26:BORDER 0 20 WINDOW #0,1,40,1,2 30 CLS 40 INPUT " Xradius for the outer circle ";xouter 50 INPUT " Yradius for the outer circle ";youter 60 INPUT " Xradius for the inner circle ";xinner 70 INPUT " Yradius for the outer circle ";yinner 80 INPUT " What colour for the drawing ";colour 90 DEG:ORIGIN 320,200,0,640,360,0 100 GRAPHICS PEN colour 110 a=PI*((xouter+youter)/2)*2 115 b=PI*((xinner+yinner)/2)*2 120 innerstep=a/b:xouter=xouter-xinner 125 youter=youter-yinner 130 FOR a=0 TO 9999999 STEP 5 140 x=SIN(a)*xouter : y=COS(a)*youter 150 IF INKEY$=" " THEN GOTO 30 160 x1=SIN (a*innerstep)*xinner 165 y1=COS (a*innerstep)*yinner 170 IF UPPER$(INKEY$)="P" THEN GOSUB 210 180 IF a=0 THEN MOVE x+x1,y+y1:ELSE DRAW x+x1,y+y1 190 NEXT a 200 END 210 DIM col$(3) 220 ORIGIN 0,0 230 col$(0)=CHR$(0) 240 col$(1)=CHR$(2) 250 col$(2)=CHR$(1) 260 col$(3)=CHR$(6) 270 FOR y=399 TO 0 STEP -2 280 PRINT #8,CHR$(27)+"K"+CHR$(64)+CHR$(1); 290 FOR x=0 TO 639 STEP 2 300 c=TEST (x,y) 310 PRINT #8,col$(c); 320 NEXT 330 PRINT #8,CHR$(27)+"3"+CHR$(3) 340 NEXT 345 ORIGIN 320,200,0,640,360,0 350 RETURN |