4-in-a-line is a game for two players or for one player playing against the system.

The 4-in-a-line 'board' represents a 7x6 vertical frame, with slots along the top, down which are dropped counters into the columns of the frame.  When a counter is dropped, it sits on top of any counters already in the column.



Each player plays with different coloured counters: one player with yellow, the other with red. Players take turns to drop one counter of their colour down a slot into any column that is not yet full.   

The objective of the game is to be the first to achieve four (or more) counters of their colour connected together in a line, either vertically, horizontally or diagonally.

When 4-in-a-line is first opened, a new game starts, playing against the system, in which the system (playing red) goes first.

Playing the game - against another person

To play another person, you first need to press the Person box at the bottom right. This turns its background green (to show that it is now selected) and the background of the System box white.

To begin a new game, press either the red counter or yellow counter below the board, depending on who is to go first.

Above the frame is a counter showing which colour is to be dropped next. The player whose turn it is presses just above or in the column into which the counter is to be dropped.

When a winning position has been achieved, the counters forming the winning line (or lines if several were achieved at once) are highlighted, and no more moves are possible. 

So, given the following position, with yellow about to drop a counter into the third column from the left:


you would see yellow's winning position highlighted as follows (two lines of four achieved simultaneously).

Playing the game - against the system

By default, games are played against the system. However, if you've played a person and then wish to play against the system, you need to press the System box, which will turn its background green.

To begin a new game, press either the red counter or yellow counter below the board, depending on who is to go first. The system always plays red.

The method of play is the same as for the two-player game, except that the system will make red's move.

Below are some hints about the system's strategy and tactics. But, first, here are some definitions of terms that are used:

Vertical trap

A vertical trap is a position where one colour has two potential lines of 4, with one blank in each, where these two blanks are vertically adjacent. It is a trap because if the opponent drops a counter to block the first 4-in-a-line, this then opens up the one above for the player to win.

Below is an example of a vertical trap. In the central column, both the 2nd and the 3rd row up would complete a 4-in-a-line for yellow (lines highlighted), so if yellow were to drop a counter down this column, red could block the first but then yellow would win with the next.

Final column trap

A final column trap is a position in which there is a potential 4-in-a-line with one blank, and the blank is in a position such that if the column it is in were to be the last column not yet completely full (when the game is coming to an end), the blank would be filled by the colour that would complete the 4-in-a-line. This is a useful position to have in the background - just in case the game is not won earlier on.

The system's strategy and tactics

First, of course, it looks to see whether it can make 4-in-a-line with the next counter or whether it needs to prevent yellow from doing so.

Then it looks to see whether it can drop a counter that will create an unbeatable position - either because red then has two ways of making 4-in-a-line, or because there is a red 'vertical trap' just above the counter to be dropped. Of course, it also checks to make sure that dropping this counter wouldn't immediately let yellow win the game.

Next, it looks to see whether yellow is about to create an unbeatable position, but dropping a red counter would prevent this.

Lastly, it tries to create good positions, while giving least away to yellow:
  • It tries to create potential lines of 4 with 3 counters in them - weighted towards creating vertical traps and final column traps.
  • If these aren't possible, it tries to create potential lines of 4 with 2 counters or 1 counter in them
When evaluating these positions, it also has a tendency towards filling columns containing one of its vertical traps, but tries to avoid putting a counter in the blank below one of its final column traps, as this would allow yellow to block the trap early.

During all this positioning, it tries to avoid giving the game to yellow, of course.

New Game

Start a new game at any time by pressing the red or yellow counter below the board.

Changing opponent

To change your opponent from the system to a person, or vice versa, press either System or Person - as you wish.

Please note that the setting you choose here comes into force only when you start a new game by pressing the red or yellow counter; there is no impact on any game already underway.

Terms of use

This software may be used for personal purposes only.  It may not be used for commercial purposes.

The software, code and script of this application may not be copied or be distributed to others.

The software, code and script may not be altered in any way.

Copyright of the software, code and script, and its help documentation, is held by TopAccolades Limited.  No part of the software, code, script or documentation may be copied or used in another application or document.

Although every effort has been made to ensure that this software functions as intended, TopAccolades Limited provides no warranty of merchantability, or fitness for a particular purpose, in relation to this application or its support.

TopAccolades Limited shall not be liable for any damages whatsoever arising out of the use of or inability to use this application or the provision of or failure to provide support.

Copyright TopAccolades Limited
www.topaccolades.com

Version: 3.0 (20170327)
Scale: