Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

ASAP!!! Page 12 Question (60 points) Write a program that allows two players to play a game of Toc-Tac-Tic. This game is also called avoidance

image text in transcribed
image text in transcribedASAP!!!
Page 12 Question (60 points) Write a program that allows two players to play a game of Toc-Tac-Tic. This game is also called avoidance tic-tac-toe. This game has similar rules to the traditional tic-tac-toe except that the Player who completes three consecutive Xs or os loses. Use a two dimensional char array with three rows and three columns as the game board. Each clement of the amay should be initialized with an asterisk The program should run loop that: 1. Displays the current contents of the board array. 2. Allows player select a location on the board for an X The program should ask the user to enter Xto the row and column number. Determines whether a player has won, or a tie has occurred 4 Allows player o to select a location on the board for an o. The program should ask the user to enter the rowa and column number. 5. Go back to step 1 if there was no tie and nobody won. a row and column values these values should be validated. The player is allowed Whenever a play to reenter the values when: both of the values the location entered was already chosen When a player wins, the program should declare the winner and terminate. If a tie has occurred, the program should say so and terminate. Payer X wins when there are three Os in a row on the game board. The Os can appear in a row, in a column, or diagonally across the board. A tie occurs when all of the locations on the board are full, but there is no winner. The following is an example of a partial run of the program: welcome to Toe Tac Tic Columns Player X's turn. Enter a row and column to place an X Invalid Row! Row: 2 Colunn 14 Invalid Column unni 2 Row 3: Player O's turn Enter a row and column to place an o

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_step_2

Step: 3

blur-text-image_step3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

4 How the market system adjusts to change and promotes progress.

Answered: 1 week ago