35 What are the three coefficients ?1,2,1 Co-incident roots X=1.00 What are the three coefficients ? Escape at line 120 > FOURPNT This program draws a pattern (lines 80 to 140) and then changes foreground and background colours with a half second pause between each change.
10 REM FOURPNT/DRAWS A PATTERN WITH 4 POINTS 20 REM JOHN A COLL 30 REM VERSION 1 /16 NOV 81 50 MODE 4 60 VDU 29,640;512 70 80 FOR A=0 TO 500 STEP 15 90 MOVE A-500,0 100 DRAW 0,A 110 DRAW 500-A,0 120 DRAW 0,-A 130 DRAW A-500,0 140 NEXT A 150 160 FOR B=0 TO 7 :REM CHANGE THE COLOUR 170 FOR C=1 TO 3 180 T=TIME :REM WAIT A WHILE 190 REPEAT UNTIL TIME-T>50 200 VDU 19,3,C,0,0,0 210 VDU 19,0,B,0,0,0 220 NEXT C 230 NEXT B TARTAN This program builds up a changing pattern by overdrawing lines on the screen. The main program between lines 90 and 140 loops for ever and calls various subroutines as necessary.
The use of subroutines with implied GOTO (eg line 170) results in a structure which is not easy to follow! It would be better to use ‘structures’ such as procedures (see chapter 17). 10 REM TARTAN 20 REM BASED ON RESEARCH MACHINES DEMO 30 REM VERSION 1.0/16 NOV 81