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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 13:00, ajayfurlow
Which option should u select to ignore all tracked changes in a document
Answers: 1
image
Computers and Technology, 24.06.2019 11:20, isabelperez063
Every telecommunication setup uses two devices: one device to transmit data and one device to receive data. which device transmits frequencies to mobile phones? towers transmit frequencies to mobile phones.
Answers: 1
image
Computers and Technology, 24.06.2019 11:40, girdwood6678
100 pts. first person gets brainliest
Answers: 2
image
Computers and Technology, 25.06.2019 01:00, mrstealyogirl40
Holly created a professional development plan to explore how she could advance from her entry-level position to the next step in her career. she has identified her current skills and the skills needed for the job she wants. what should she do now? a) ask a colleague for advice about work-life balance b) identify her areas for improvement c) plan a vacation before she begins her new job d) wait until a position opens before continuing her plan
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 in other subjects:

Konu
Mathematics, 04.07.2019 06:30