Acorn Computers BBC Micro Model B w/8271 — Acorn BBC Micro Model B w/8271 User Guide Manual PDF (EN)

32 340 MOVE X(SIDE), Y(SIDE) 350 DRAW X(line), Y(line) 360 NEXT line 370 NEXT SIDE 380 NEXT C 200 GCOL 0, RND(4) MONTHLY You may like to try this alternative for line 200 This program plots a set of ‘blocks’ on the screen which might represent prices over a 12-month period. In this example the height of the bars is randomly selected at line 170. Lines 180 to 270 then draw a ‘solid’ bar and the edges are marked in black by lines 290 to 330. Lines 340 and 350 print out one letter representing the month of the year at the bottom of each bar. Notice that lines 60 and 70 set up two of the function keys. Key f0 sets the computer to MODE 7 and then lists the program.

Key f9 can be used to run the program. 10 REM MONTHLY 20 REM JOHN A COLL 30 REM VERSION 1 / 16 NOV 81 50 60 *KEY 0 "MODE7 |M LIST |M" 70 *KEY 9 "RUN |M" 80 M$="JFMAMJJASOND" 90 C=0 100 MODE 2 110 VDU5 120 VDU 29,0;100; 130 140 FOR X=0 TO 1100 STEP 100 150 GCOL 0,C MOD 7+1 160 C=C+1 170 H=RND(400)+200 180 MOVE X,0 190 MOVE X,H 200 PLOT 85,X+100,0 210 PLOT 85,X+100,H 220 MOVE X+70,H+50 230 MOVE X,H 240 PLOT 85,X+170,H+50 250 PLOT 85,X+100,H 260 PLOT 85,X+170,50