Computers and Technology

In this lab, you will develop a game, "Tic Tac Toe". Assume there are two players; the computer and theuser.Initially you will create the board, a 3x3 matrix, and fill it out with zeros.Ask user to start first, and record the user’s input as 1You can ask the user to enter the row first than the column (for ex; the user can enter 2 and 1,then the code shouldupdate the value of second row first column)The computer should make random moves, and the computer input should be recorded as 2After each move, check if someone wins, and display the boardDisplay the result (who wins and the board)Create as much helper functions as needed.Divide and ConquerSampleRun:board = [[0,0, 0],[0,0, 0],[0,0,0]]enter the row;2enter the column;1board = [[0,0, 0],[1,0, 0],[0,0,0]]the computer playsboard = [[0,2, 0],[1,0,0],[0,0,0]]CS103-Lab9Page4o f6enter the row;2enter the column;2board = [[0,2, 0],[1,1, 0],[0,0,0]]the computer playsboard = [[0,2, 0],[1,1, 0],[0,0,2]]enter the row;2enter the column;3board = [[0,2, 0],[1,1,1],[0,0,2]]Game Over Winner: The User

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 14:30, HaPow6019
The egyptians invented the ? to water their crops, and may have used the ? to build the pyramids.
Answers: 1
image
Computers and Technology, 22.06.2019 15:30, mariap3504
Whats are the different parts of no verbal comunication, especially body language?
Answers: 3
image
Computers and Technology, 22.06.2019 19:30, 710jonathan
The following is an excerpt from a slide presentation. today we will inverse operations solving equations using inverse operations solving inequalities using inverse operations from which part of the presentation does the slide most likely come from? a. introduction b. outline c. body d. conclusion
Answers: 1
image
Computers and Technology, 22.06.2019 20:10, ianmartin6080
Assume that minutes is an int variable whose value is 0 or positive. write an expression whose value is "undercooked" or "soft-boiled" or "medium-boiled" or "hard-boiled" or "overcooked" based on the value of minutes. in particular: if the value of minutes is less than 2 the expression's value is "undercooked"; 2-4 would be a "soft-boiled", 5-7 would be "medium-boiled", 8-11 would be "hard-boiled" and 12 or more would be a "overcooked".
Answers: 1
Do you know the correct answer?
In this lab, you will develop a game, "Tic Tac Toe". Assume there are two players; the computer and...

Questions in other subjects:

Konu
Mathematics, 24.03.2021 18:10
Konu
Mathematics, 24.03.2021 18:10
Konu
Mathematics, 24.03.2021 18:10
Konu
Mathematics, 24.03.2021 18:10