DEFDBL A-Z pi = ATN(1) * 4 leng = 220 alf = 0 x0 = 300: y0 = 240 SCREEN 12 LOCATE 6, 1: COLOR 11 PRINT " Rational and irrational numbers," PRINT " as ratios between angular increment of a" PRINT " description point on circle, and 360ø." LOCATE 12, 1: COLOR 7 PRINT " -> Choose angular increment, in degrees:" PRINT " 'rational' (= few decimals) will cycle" PRINT " 'irrational' (= many decimals) won't cycle" PRINT " -> Press SPACE to toggle between drawing and clearing" PRINT " If cycling, the clearing will be quick and complete" PRINT " If not (or after some time), uncleared parts remain..." PRINT " -> Press other key for choice of new increment" PRINT " Interesting values increment: around 5,60,90,180,270, eg 60.5 ..." PRINT " 'Irrational' incrs.: 3.1415927 (pi), 31.62278 (SQR1000)..." COLOR 14: LOCATE 24, 27: PRINT "Credits: guido wuyts 1995" col = 0 FOR alf = 0 TO 360 STEP 5 col = (col + 1) MOD 7 + 9 a = alf * pi / 180: c = COS(a): s = SIN(a) PSET (x0 + leng * c, y0 + leng * s), col NEXT alf PLAY "l21o3cc+dd+ee-dd-c" col = 11: a$ = "" WHILE a$ = "" COLOR col: LOCATE 27, 28 PRINT "-> Press a key... " tijd = TIMER: WHILE TIMER - tijd < .5: WEND IF col = 11 THEN col = 5 ELSE col = 11 a$ = INKEY$ WEND a$ = "": CLS weer: PLAY "o4l12d": COLOR 3 LOCATE 1, 1: INPUT "-> Choose angle (0=END) :", dalf IF dalf = 0 THEN PLAY "o4l12d": END kies: LOCATE 1, 1: PRINT " " LOCATE 1, 1: INPUT "-> type '.' for dots, else = radii. Choice : ", tek$ IF tek$ = "." THEN tek = 1 ELSE tek = 2 a$ = "": b$ = " " CLS : vlag = 0 LOCATE 1, 65: PRINT USING "#####.##########"; dalf alf = -dalf DO WHILE a$ = "" OR a$ = " " alf = alf + dalf x = x0 + leng * COS(alf * pi / 180) y = y0 + leng * SIN(alf * pi / 180) SELECT CASE tek CASE 1: GOSUB punt CASE 2: GOSUB straal END SELECT a$ = INKEY$ IF a$ = " " THEN IF b$ = " " THEN b$ = "clearing..." ELSE b$ = " " LOCATE 1, 1: PRINT b$ vlag = ABS(vlag - 1) END IF LOOP GOTO weer END punt: IF vlag = 1 THEN PSET (x, y), 0 ELSE PSET (x, y), 11 RETURN straal: col = col + 1 c = col MOD 16 IF c = 0 THEN c = 1 IF vlag = 1 THEN c = 0 LINE (x0, y0)-(x, y), c RETURN