subject

You are required to submit a script file tictactoe. m and supporting functions (modular

design carries 10 points) to get credit for this assignment

when we run tictactoe. m script file, it should start with a welcoming message and show the dashboard of player/computer wins, draws and asks the player to flip a coin

if you enter an invalid input (anything other than h or t), it should prompt the player again!

once a valid character is entered, the game should start. you need to write code to simulate coin toss and decide whether the player or computer gets to start the game

if computer wins the toss, it plays first. you need to write code to let the computer randomly pick a vacant box on the board. computer uses ‘o’ symbol on the board

if you win the toss, you get to play first. you need to write code to get input for row and column number. player uses ‘x’ symbol on the board

so far, so good! here is where it gets tricky. you should not accept any invalid value for row and column numbers (the board is a 3 x 3 matrix). also, if a box is taken, you have to prompt the player again to enter a vacant box row and column

snapshots on next page!

input validation is a key task and you should take care of all these corner cases.

here are the snapshots of a successful game play where player won

here are the snapshots of a successful game play where the game is draw

if you observe, the dashboard at the beginning of the game keeps track of player wins, computer wins and number of draws in current session

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 15:20
What does a bonus object do? a. subtracts lives b. keeps track of a player's health c. gives a player an advantage d. makes text appear
Answers: 1
question
Computers and Technology, 24.06.2019 11:20
Print "censored" if userinput contains the word "darn", else print userinput. end with newline. ex: if userinput is "that darn cat.", then output is: censoredex: if userinput is "dang, that was scary! ", then output is: dang, that was scary! note: if the submitted code has an out-of-range access, the system will stop running the code after a few seconds, and report "program end never reached." the system doesn't print the test case that caused the reported message.#include #include using namespace std; int main() {string userinput; getline(cin, userinput); int ispresent = userinput.find("darn"); if (ispresent > 0){cout < < "censored" < < endl; /* your solution goes here */return 0; }
Answers: 3
question
Computers and Technology, 24.06.2019 15:50
Andy would like to create a bulleted list. how should he do this? andy should click on the bullet icon or select the bullet option from the menu and then type the list. andy should press the shift key and the 8 key at the beginning of each line of text. andy should type the text and then click on the bullet command. andy should press return and the bullets will automatically
Answers: 2
question
Computers and Technology, 24.06.2019 17:40
Pseudocode pld #6, pg. 117 start// declarations// number numbertoguess// number myguess; numbertoguess = 92// while myguess ! = numbertoguess// output " guess an integer number between 1 and 100"// input myguess// if (myguess == numbertoguess)// output "you guessed the correct number"// else// output "the number you guessed was incorrect. try again! "// end if// end while// output " for playing the guessing game. have a great day! "// stop
Answers: 3
You know the right answer?
You are required to submit a script file tictactoe. m and supporting functions (modular

...
Questions
question
Chemistry, 26.07.2019 16:00
question
Mathematics, 26.07.2019 16:00
question
Biology, 26.07.2019 16:00
Questions on the website: 13722367