Beebug


Four In A Row

 
Published in Beebug Volume 2 Number 1

The Game

Four-In-A-Row is a nice colourful implementation of the commercially available game 'Connect Four'. The object is to get four counters in a row, either horizontally, vertically or diagonally on a 6 x 7 playing board. It is a game where two players take alternate turns, deciding in which column to place a counter. You cannot choose what row to put it in, counters just pile up from the bottom.

In this implementation you can play against the Beeb, or another person. Four In A Row is a game of strategy, and the program plays quite a fair game. Generally speaking, it will win unless you can set a trap for it by gradually building up two interrelated rows of four. This implementation plays a better game than the only other computer version that I have seen, which ran on a UK141.

Operating Notes

The game uses Mode 1, and therefore requires a 32k machine, but it will fit into a disc machine if you set PAGE to &1108 (i.e. enter PAGE=&1100 (RETURN)) before loading (or entering from keyboard) - but remember not to press Break. Once you have it on disc it may be useful to have a short header program saved separately on disc which resets PAGE. For example:

10 REM short header for 4INAROW
20 PAGE=&1100
30 CHAIN"4"

Save this under the title "4INAROW", and save the main program under the title "4". Then to load just CHAIN "4INAROW"

The colours used in the program are pretty, but the yellow is a little difficult to see against the surrounding white frame. To make it magenta, add:

145 VDU19,2,5,0,0,0

Alternatively, if watching in black & white, try deleting line 280, or better still add:

145 VDU19,2,1,0,0,0