What it does

Basically as the title says, simulates the real world connect-4 game in the command line (text-based). It allows the user to create their own boards by allowing them to set a custom size for the board, from as small as 5x5 to as large as 30x30, rather than using a fixed-size board. It also supports up to 9 players

HOW TO PLAY:

  • Download and run connect.py from the repo

  • Follow the prompts. Note that the board is represented by a 2D list of type int. A cell with a 0 indicates an empty cell, while a cell with a number from 1 to 9 indicates that the cell is occupied by that player number (ie: A cell with a 1 is occupied by player 1, and a cell with a 2 is occupied by player 2)

  • Currently there is no handling for wrong keyboard inputs, so make sure that when asked, you only input numbers. If you make a typo, or you press enter without typing anything, you will have to restart the game. I am looking to fix this when I implement the game on the GUI instead of the command line environment

How we built it

Built purely using python

Challenges we ran into

Debugging was a pain, as there were a lot of edge cases to consider.

What we learned

I improved my algorithmic thinking and debugging ability, and practiced using recursion to find a winning streak of four in a row.

What's next for Connect-4

Very soon, I will implement this in a pygame or a GUI, to make it much more playable than the command line.

Built With

Share this project:

Updates