Inspiration

I didn't have any idea of what I wanted to do when I arrived and the group I joined disbanded so I wanted to do a simple game that I figured I could complete but also make look and function well

What it does

It displays a Connect Four game 'board' and users input which slot to put their piece. The board updates with each move and will automatically let you know if someone wins.

How I built it

I started with making an empty grid and used a 2D char array. I then added a method for adding pieces, and added onto it by adding the 'gravity' of the pieces, making them fall. To avoid potential problems I put safety checks to make sure the slot players are trying to put the piece into exists and is not full. I then created a loop for the gameplay turns, and made an algorithm for detecting 4 pieces in a row anywhere on the board.

Challenges I ran into

I originally was trying to set up GUI for my team's project, but they disbanded, and I tried to continue with GUI but it was overwhelming and difficult to set up, so I stuck with text. The win checking was checking in making sure the 4 pieces were the same, what the pieces were if they were the same, and how to go about checking for the different variations of connected 4.

Accomplishments that I'm proud of

I'm proud I made a working game that is easy to see what's going on even though it is only text.

What I learned

I learned more about dealing with 2D arrays. I haven't really seen them other than one other time.

What's next for Connect Four In Text

I originally wanted to make something in GUI because they are more visually pleasing and interactive, so once I figure that out I will migrate the board and inputs to graphics.

Built With

Share this project:

Updates