Computers and Technology
Computers and Technology, 26.11.2019 22:31, dacey4164

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

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 09:30, cdavis379
:you areto design the controller for alight that functions both as an ordinary light and also as a motion activated light and alarm. a. if the manual switch s is on, then the light l is on. b. besides the manual switch, there is a motion detector, m1, which activatesthis light. c.if motion is detected but the light is on anyway because s is on, only then a secondoutput a, an alarm, is turned on. d. the disable switch, d, disables the motion activated light and alarmbut leaves manual control operation of the light using switch s.(i)read the problem statement and clearly identify the inputs and outputs for the circuit you are designing. (ii)create the truth table for this system; include the light, alarm, switch, disable, and the motion sensor.(iii)draw a schematic of this system.
Answers: 1
image
Computers and Technology, 23.06.2019 18:00, taiyana74
Ramona enjoys her job because she is able to kids in an after school program. the work value ramona feels strongest about is a. leadership b. risk c. independence d. work with people select the best answer from the choices provided a b c d
Answers: 1
image
Computers and Technology, 24.06.2019 13:50, Estefaniamarilicolin
What does code do? a creates a text box that says "solid black" b creates a black border of any width c creates a black border 1 pixel wide
Answers: 1
image
Computers and Technology, 24.06.2019 19:30, luckye
Can someone who is skilled at coding create me a java chess game. don't copy from online source codes. make it original ! : d
Answers: 1
Do you know the correct answer?
You are required to submit a script file tictactoe. m and supporting functions (modular

...

Questions in other subjects:

Konu
Mathematics, 03.08.2019 00:30
Konu
Mathematics, 03.08.2019 00:30