A short SuperBASIC demonstration of the QL’s built-in turtle graphics. Enter an odd number of sides and the turtle draws a star with that many points, using POINT, PENDOWN, TURNTO, MOVE and TURN; five sides give a five-pointed star.
Tim Swenson suggests adding FILL statements to see what happens. The zip has the program as turtle_bas and a QL floppy image holding it: mount the image as FLP1_ and type LRUN flp1_turtle_bas.
Published in Sinc-Link January-February 1990 (Turtle Graphics).
Source Code
100 CLS
110 INPUT "How many sides?"!sides
120 LET angle = (360*(INT(sides/2)))/sides
130 CLS
140 POINT 10,50
150 PENDOWN
160 TURNTO 0
170 FOR x = 1 TO sides
180 MOVE 50
190 TURN -angle
200 NEXT x
210 BEEP 2000,10
220 PAUSE
230 GO TO 100Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.