Question
Write a C++ program that plays a simple game of TicTacToe against a user. The user will input the Xs and the computer will counter
Write a C++ program that plays a simple game of TicTacToe against a user. The user will input the "X"s and the computer will counter with "O"s. The program will update the display after each user input and each computer input. The program will end after someone wins the game (all "X"s or all "O"s in a row) or all 9 spaces are played.
** Below is a screenshot of my main function. I already have this program 99% finished. I am just trying to add User Input Validation. I was thinking about changing my while loop to a do while loop possibly, somewhere between lines 39-41, or maybe using a "try" statement or For Loop? I just need some help tweaking this just a little. The Input Validation should display an error message if the user enters a value other than 0-8 to make a move on the Tic Tac Toe Display, and then re-prompt them to enter a number 0-8. It should say something like: "That Is Not A Valid Move. Please Enter A Number [0-8]. "
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started