Question
We all know the game of TicTacToe. Its easy, quick and fun. In this assignment, you will implement a computerized version of the game using
We all know the game of TicTacToe. Its easy, quick and fun. In this assignment, you will implement a computerized version of the game using a 2-dimensional array. This game will be played by two humans sharing the same keyboard. The screen will also show the snapshot or the state of the board after every players move. You will store the board as a single 2-dimensional array of base type char that has 3 rows and 3 columns. Your program should: Keep track of whose turn it is (X or O) and inform the player about it. Allow a player to make a move. A player makes a move by informing your program at which location of the board he/she wants his/her respective symbol (X or O) to be placed. The options are as follows: 0 0, 0 1, 0 2, 1 0, 1 1, 1 2, 2 0, 2 1, 2 2. Notice that the player informs the row number, followed by a space, followed by a column number. Your program should verify if the move is valid (for example, 3 1 is not a valid move) and, in case of an invalid move, inform the user about it and ask for a valid move again. Verify if there is a winner after every players move and also if the board is already full but we have no winners. Your program should also allow the player to reinitialize the game to the beginning.
Code should match this format: (C++ Language)
New Game: X goes first RICI 01 2 I X' s turn. Where do you want your X placed? Please enter row number and column number separated by a space. You have entered row #0 and column #0 Thank you for your selection RICI 01 2 I o' s turn. Where do you want your O placed? Please enter row number and column number separated by a spaceStep 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