Skip to content

Connect Four is a classic 2 player game. It is a variation of tic-tac-toe played on a rectangular board. Typically there are 6 rows and 7 columns, although this code will work for any number of rows and columns. The game is played by two players, alternating turns, with each trying to place four checkers in a row vertically, horizontally, or dia…

Notifications You must be signed in to change notification settings

RishikeshYadav95/connect4

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

CONNECT 4

Connect Four is a classic 2 player game. It is a variation of tic-tac-toe played on a rectangular board. Typically there are 6 rows and 7 columns, although this code will work for any number of rows and columns. The game is played by two players, alternating turns, with each trying to place four checkers in a row vertically, horizontally, or diagonally. Because the board stands vertically and the checkers are subject to gravity, a checker may only be placed at the top of one of the currently existing columns (or it may start a new column). Connect Four is a variation of tic-tac-toe played on a rectangular board. Typically there are 6 rows and 7 columns, although your code will work for any number of rows and columns. The game is played by two players, alternating turns, with each trying to place four checkers in a row vertically, horizontally, or diagonally. Because the board stands vertically and the checkers are subject to gravity, a checker may only be placed at the top of one of the currently existing columns (or it may start a new column).

How to install and run CONNECT 4

Follow the steps to run CONNECT 4.

  1. Fork the Project / Download the source code as a zip file
  2. Navigate to the project directory
  3. Run the connect4.py python file

How to use CONNECT 4

Follow these steps to play CONNECT 4.

  1. On running the CONNECT 4 application, it will prompt the user to provide the dimensions for the board.
  2. Once the user has entered the dimensions, a board with the given specifications is created and the users can start playing the game.
  3. The game starts with X's turn and then based on user's choices, the game progresses.
  4. The game ends as soon as either of the players has 4 checkers in a row vertically, horizontally, or diagonally.
  5. After the game ends, the user is prompted if they want to restart the game or not.
  6. If the user decides to restart, they are again prompted for the new board dimensions.
  7. If not, then the game terminates.

Contributing

If you have to add a feature, please fork the repo and create a pull request.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/Feature)
  3. Commit your Changes (git commit -m 'Adding Feature')
  4. Push to the Branch (git push origin feature/Feature)
  5. Open a Pull Request

(back to top)

About

Connect Four is a classic 2 player game. It is a variation of tic-tac-toe played on a rectangular board. Typically there are 6 rows and 7 columns, although this code will work for any number of rows and columns. The game is played by two players, alternating turns, with each trying to place four checkers in a row vertically, horizontally, or dia…

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages