Side Note

My GitHub wasn’t working, and I tried creating a second account, and it still didn’t work there, so I just made a google doc with all of my code, and this doc is linked to this submission.


Creating a connect four board game has been on my bucket list for a long time, as it is a fairly simple project for a beginning programmer and you can learn a lot from it. At first, I wanted to code this using turtle but realized that pygame was a lot better, and using inspiration from Keith Galli, a programming youtube, I was able to find an approach to this project.

What it does

It is a replica of the board game connect four, but online. Two players use the screen and start clicked the mouse, trackpad, or screen(if touchscreen), to place their tokens and win the game by getting 4 in a row.

How we built it

The majority of building the program was defining functions that would help me check for winning pairs, create the gameboard, rotate the board, and check if the input was valid. The other part of the program was the main game loop, where I used all of the functions to create a final game that worked. As mentioned, I used Keith Galli's videos to gain an understanding of the project and two libraries that I didn't know too much about, numpy and pygame. After my final product was finished, I just played around with my board a lot and found many bugs and errors, so a majority of my time was devoted to fixing these errors and making my program more efficient.

Challenges we ran into

There were a lot of bugs in the beginning so I had to go in and fix them all, and that took the majority of my time so I couldn't add all of the extra features that I wanted to.

Accomplishments that we're proud of

That I was able to debug the program and make it work to the best of my ability as well as adding in an extra feature, that allows the user to generate any board size and being able to create this with in my first official hackathon,

What we learned

I learned a lot about pygame, as usually I used turtle for python graphics, after learning pygame for this hackathon, I realized that pygame is a lot more efficient and works a lot better, as well as how to use pygame better.

What's next for Connect Four

I believe that the three next main steps for this project are to create an ai bot that plays against you in connect four so that you can enjoy the game alone. Our second main step is to create a feature where the user can type in their variant of the game, for example, connect 5 or connect 6. Our third step would be to create an online multiplayer interface, where people all over the world using the internet can play each other, and possibly create a rating, like or lichess.

Built With

Share this project: