/p4Game

Primary LanguageJavaScript

P4 Game

The goal of the game is to align 4 pawns on a grid with 6 rows and 7

columns. Each player has 21 pieces of one color (for each

Convention, usually yellow or red).

In turn the two players place a pawn in the column of their

Choice, the peg then slides to the lowest possible position

In the said column as a result of which it is for the opponent to play.

The winner is the player who realizes the first one alignment

(Horizontal, vertical or diagonal) of at least four pieces of its color.

If, while all of the boxes in the game grid are filled, none

Of the two players has made such an alignment, the game is declared

nothing.

Work to do

You will implement your program by initializing a data structure to represent the

Example, then a method taking this data structure as a parameter and testing whether the

Red Camp won the game or not, with a result display in the console.