Summary

Develop a Tic Tac Toe game that will match a player against the computer.

Requirements

Use a typical 3 x 3 board. The vertical columns must be labeled A, B, C. The horizontal rows must be labeled 1, 2, 3. For Example: see image.

Must do's:

  • Use User-Defined Functions.
  • Use Branching.
  • Use Loops.
  • Use String functions.
  • Randomly determine who will move first, the human or computer.
  • Assign O to the computer and X to the Human player.
  • Ask the user to select their move using the horizontal and vertical position. For example: A1 for the upper left square, or B2 for the center square.
  • After each move, redraw the board with the X's and O's in the right positions.
  • After each game, ask the user if they want to play again. If they do, start the game again.

Must not do's:

  • Don't use User Classes or Objects
  • Don't use images
  • Don't copy a solution, even if you can find it, on the Internet or any other source. It will be discovered and you will receive zero points for the project.

Part 1 - Design the program

  • Describe the principle functions you will be using, their purpose, parameters, and return type.
  • Create a Process Flow Diagram that describes how control flows through your program.

Part 2 - Develop and test the code

  • This seems self explanatory.

Game Setup

At the beginning of a game, clear all X's and O's from the board and randomly determine whether the computer or the player will select first.

Game Play

A player wins when they put their market on three consecutive squares, either horizontally, vertically, or diagonally. If all squares have filled with markers and neither player won, declare a tie and complete the game.

After each game, check with the human player to see if they want to play again.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.