2

Market Day


The User Guide specifies that there are 16 colours available on the BBC Micro. This is rather misleading, since eight of these are flashing versions of the others. On the other hand, the Guide says nothing about innumerable other effects easily obtained, such as striped colours in infinite variety. As soon as I saw this effect, there immediately shot into my mind the thought of deckchair material, or the gay striped canvas that one often sees over market stalls. So this little program was born.
   The program does nothing but print a number of squares in striped and plain colours, the squares growing larger towards the bottom of the screen and thus giving the illusion of depth. The various stripes and colours are randomly chosen, so each run gives a different set. If nothing else, it illustrates the wide variety of effects that are obtainable on the BBC computer.
   Lines 30, 40 and 50 change colours 8-15 (the flashing varieties) into steady versions, but the single command *FX10,0 would do exactly the same thing. The next few lines fix the width and height of the squares in each row, with the colour - striped or plain - chosen in line 120. Line 180 stops the program when the bottom of the screen is reached.

Variables

XGeneral counter
ROWThe height up the screen of the top of each square
SIZEThe width of each square
COLUMNThe position from the left edge of the screen

   10 REM - Market Day
   20 MODE2
   30 FOR X=0 TO 7
   40 VDU19,X+8,X,0,0,0
   50 NEXT
   60 ROW=1100
   70 REPEAT
   80 SIZE=(60-ROW/20)*4
   90 ROW=ROW-SIZE-2
  100 FOR COLUMN=1 TO 15
  110 MOVE COLUMN*SIZE,ROW-100
  120 GCOLRND(255),0
  130 PLOT0,SIZE,0
  140 PLOT81,-SIZE,SIZE
  150 PLOT1,SIZE,-SIZE
  160 PLOT81,0,SIZE
  170 NEXT
  180 UNTIL ROW<=0