After learning the basics about programming with C#, I wanted to take a crack at an actual project. And because I need a break from reading lesson after lesson. This project was available via Code Academy. It was written for Python but I created it C# as its just my coding language preference.
The purpose of the project is to create the Connect Four game as a data structure and display it in the console. The goal is to accomplish these tasks:
- Represent the game of Connect Four as a data structure.
- Display the data structure to the user in a way that makes sense.
- Better understand and practice using logic and data structure in a real way.
- Display the board and pieces in the windows console.
- Display messages when an invalid move is attempted. For example,
- Cannot place a piece in column 0 or 8.
- Cannot place a piece in a column that is full.
- Indicate when a player has won the game after getting 4 pieces of the same type vertically, horizontally, diagonally.
- Only 2 players are accespted and their pieces are displayed differently on the board.
- When a piece is placed in a particular column, it should be placed in the correct row as if it fell to the appropriate spot.
- Represent a game of Connect Four as a data structure. You should be able to edit the data structure directly to add pieces to the board. A traditional Connect Four board is 7 columns and 6 rows.
- Display the connect four board to your users. This will involve parsing your data structure to print out the correct pieces in the correct location.