Question: Using visual logic build a tic tac toe game. Use the console for all input and output. Samples of what the game should look like

Using visual logic build a tic tac toe game. Use the console for all input and output. Samples of what the game should look like are provided below. There are two versions of this game that you can produce. One is a user vs user mode, the other is user vs computer. Use an array to keep track of the available squares in the game board. The game will require the use of an indefinite loop that ends when someone wins or there are no more possible moves. For both versions you will require a function/procedure to print out the current state of the board, called printBoard, so that the user can choose their next move. The current state of the board will also print along with a selection guide ( as seen in the samples). You will require another procedure to take the user input, called userMove, and make appropriate changes to the array containing the board status. Use appropriate error checking to make sure that they enter a valid range and that there isn't already something in that position in the board. You will also have to keep track of who'se turn it is. This userInput procedure will require the use of another function/procedure, called checkBoard, that checks to see if the last move resulted in a win, if so the appropriate output is shown and the game is terminated. The second mode of this game is worth slightly more points. It requires some modification to the userMove() procedure and the addition of a new procedure called aiMove that make moves for player X. It is very similar to userInput, with the diference that instead of getting input from the user, the program will use the Random() function to pick a number between 1 and 9. The same validation checks should be used to ensure the square the computer randomly picks is not already taken.

Samples

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!