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 10:00
Now, open this passage to read about fafsa requirements. describe the information you will need to provide in order to complete a fafsa. list at least three of the required documents you must include.
Answers: 3
question
Computers and Technology, 23.06.2019 18:00
While inserting images, the picture command is usually used to insert photos from a digital camera, and the clip art command is usually used to a.edit the sizes and other characteristics of photos that have been inserted. b.take a screenshot of an image and copy it to the clipboard for pasting. c.search for drawings or other images from a library of prepared pictures. d.make illustrations using lines and shapes that are easy to manipulate.
Answers: 1
question
Computers and Technology, 23.06.2019 19:00
Write a program that displays the following menu: geometry calculator 1. calculate the area of a circle 2. calculate the area of a rectangle 3. calculate the area of a triangle 4. quit enter your choice (1-4): if the user enters 1, the program should ask for the radius of the circle and then display its area. use the following formula: area = ď€(the square of r) use 3.14159 for ď€ and the radius of the circle for r. if the user enters 2, the program should ask for the length and width of the rectangle and then display the rectangle’s area. use the following formula: area = length * width if the user enters 3, the program should ask for the length of the triangle’s base and its height, and then display its area. use the following formula: area = base * height * .5 if the user enters 4, the program should end. input validation: display an error message if the user enters a number outside the range of 1 through 4 when selecting an item from the menu. do not accept negative values for the circle’s radius, the rectangle’s length or width, or the triangle’s base or height. note: if the user enters an improper menu choice (1-4), the program prints "the valid choices are 1 through 4. run the program again and select one of those." if the user enters a negative radius, the program prints "the radius can not be less than zero." if the user enters a negative value for height or base, the program prints "only enter positive values for base and height."
Answers: 1
question
Computers and Technology, 23.06.2019 21:00
Which set of steps will organize the data to only show foods with more than 100 calories and rank their sugar content from greatest to least?
Answers: 1
You know the right answer?
You are required to submit a script file tictactoe. m and supporting functions (modular

...
Questions