Connect four is an absorbing and challenging game of


Homework - Connect 4

Connect Four is an absorbing and challenging game of vertical strategy that's easy to learn and fun to play. Rules are simple. Each player tries to build a row of four playing pieces in the frame - horizontally, vertically, or diagonally - while trying to prevent his opponent from doing the same.

Game objective - Be the first player to get four of your checkers in a row - horizontally, vertically or diagonally.

Game Rules -

1. Choose who plays first.

2. Each player in his turn drops one of his checkers down any of the slots in the top of the grid.

3. The play alternates until one of the players gets four checkers of his colour in a row. The four in a row can be horizontal, vertical, or diagonal.

4. The first player to get four in a row wins.

5. If the board is filled with pieces and neither player has 4 in a row, then the game is a draw.

Your Task - Implement the connect 4 game. Two users would play the game;

Choose 'X' and 'O' instead of the black and red checkers

Ask the user to input the column on where he wants to insert his checker

  • Check if this move is valid?
  • If the move is valid check if this move can make the user win

Alternate between the two users.

Request for Solution File

Ask an Expert for Answer!!
Dissertation: Connect four is an absorbing and challenging game of
Reference No:- TGS02683034

Expected delivery within 24 Hours