subject

You are to write a game called gato. That is Tic-Tac-Toe, for those of you that have not heard the name in Spanish. First you need to draw the board using classes from the graphics library discussed in class. Next, ask the user to click on a empty spot on the board and display alternating X’s and O’s on the locations of those mouse clicks. After 9 clicks, presumably when the board has been filled up, the game ends. You must display a "Game over" message somewhere on the viewing window and proceed to ask the user whether or not another game is to be played. The program should end when the user enters a negative response to this question.

For this assignment you may assume:

The user knows how to play the game; that is, once a location of the board is occupied, the user will not try to click on that location again unless a new game has started.

The game ends after 9 clicks regardless of whether or not there is an actual winner.

The player who draws the O’s always gets to start the game (i. e., when the board is empty the first symbol displayed will be an O).

Notice that there could be many individual games of gatoevery time the program is run. You will not know in advance whether the user wants to play 1, or 100 games; your program should adjust accordingly. Also, notice that at every individual game, exactly 5 O’s and 4 X’s are to be drawn.

The purpose of this assignment is that you code your program efficiently. You should not repeat the procedure for drawing an O or an X more than necessary. In other words, you should loop the part of your code that performs the drawing rather than simply repeating your code multiple times.

Here is some more information about your assignment:

You are not expected to write code that plays the game of Tic-Tac-Toe against the user. Instead, the user will choose all locations for all of the O’s and all of the X’s.

You are not responsible for tracking poor mouse clicks by the user, such as not clicking within a box or a user clicking all 9 X’s and O’s in the same box (remember: you are under the assumption that the user knows how to play the game).

You are not responsible for deciding whether or not there is a winner.

(+1 point) Instead of drawing an O, sketch a guajolotero bus. To get this point, it should be absolutely clear that your sketch indeed represents a guajolotero bus and not just a generic bus.
(+1 point) End the game at the first occurrence of a 3-in-a-row. In this case, a line through the winning 3 spots must be drawn and you must declare the winner: O or X.
(+2 points) Write an intelligent Tic-Tac-Toe playing system so that the computer plays against the user.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 15:00
Visually impaired individuals generally rely on the for navigation. thus, designers need to ensure that mouse-specific inputs, such as pointing, clicking, and hovering, can be done without a mouse.
Answers: 1
question
Computers and Technology, 24.06.2019 09:00
Why might you chose to crest a function resume
Answers: 1
question
Computers and Technology, 24.06.2019 13:20
3. ranga ramasesh is the operations manager for a firm that is trying to decide which one of four countries it should research for possible outsourcing providers. the first step is to select a country based on cultural risk factors, which are critical to eventual business success with the provider. ranga has reviewed outsourcing provider directories and found that the four countries in the table that follows have an ample number of providers from which they can choose. to aid in the country selection step, he has enlisted the aid of a cultural expert, john wang, who has provided ratings of the various criteria in the table. the resulting ratings are on a 1 to 10 scale, where 1 is a low risk and 10 is a high risk. john has also determined six criteria weightins: trust, with a weight of 0.3; quality, with 0.2; religious, with 0.1; individualism, with 0.2; time, with 0.1; and uncertainity, with 0.1. using the factor-rating method, which country should ranga select? why? (2 points)
Answers: 3
question
Computers and Technology, 24.06.2019 20:30
Where is permanent data in the computer stored whenever gym starts his laptop he sees some commands in numbers appearing on the screen these instructions are being preceded by the control unit in
Answers: 1
You know the right answer?
You are to write a game called gato. That is Tic-Tac-Toe, for those of you that have not heard the n...
Questions
Questions on the website: 13722367