B. User Manual

Game Description:

Connect 4 is game in which two players compete to align four coins in a row, column, or diagonally. The coins are different colors to differentiate between the two players. One player starts by placing a coin in an acceptable position (the coin cannot be in the air with no other coins beneath it) and the other player follows by placing one of their coins. This continues until one player succeeds in aligning 4 of their coins in one of the winning outcomes.

Rules:

  1. A win is classified by 4 coins of the same color being aligned in a row, column, or diagonally
  2. A coin can only be placed if it is at the bottom of the board or if there are other coins beneath it (no floating coins)
  3. If a player attempts to place a coin on an invalid position, no coin is placed and the players turn is skipped.
  4. A full board results in a tie

How to Play:

  1. Open program in Matlab
  2. Click “Run”
  3. User the cursor to place a coin on the game board
  4. Alternate turns, and play until the game results in a win or tie

Program Description:

The program begins by creating the game board and the sprites used for visuals. It then prompt the user to select a spot to place the coin, and uses the position and check if it is an acceptable place to put the coin. If a coin is able to be placed, a sprite of the proper color coin is placed. If not, the player is punished and his turn is skipped. When a coin is placed, it becomes the other players turn. Each time a coin is placed, every win possibility is checked. If a win is detected, it will print the color of the winner. If the board fills up, it will print that the game is a tie.