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, 22.06.2019 02:40
Respecting individual differencespre-test active2time remaining48: 47nina is exploring her gender identity and sexual orientationwhich best describes how the role of the media might influence nina during this time in her life? the media would her decide because television shows are always unbiased about gender issues and do notstereotypethe media could make things difficult for her because television sometimes portrays rigid ideas about gender roles.all forms of media will her decide because the media always portrays rigid ideas about gender roles.all forms of media will make things easy for her because the media always portrays open and fair ideas about gender roles.
Answers: 1
question
Computers and Technology, 22.06.2019 10:00
When is an original work considered public domain? a. when posted via social media b. when it is posted on the internet c. when a copyright symbol is not included with the piece of work d. when explicit permission is given by the author / owner
Answers: 1
question
Computers and Technology, 22.06.2019 10:40
Program using c++ only on visual studio pig is a simple two player dice game, played with one die. the first player to reach or surpass 50 is the winner. each player takes a turn rolling the dice. they add to the pot with each roll, having to decide to roll again and increase the pot, or cash out. the risk being they could lose the amount they’ve accumulated into the pot. the rules for each player’s die roll. 1. roll the dice. a. if user rolled a 1, i. the pot gets set to zero ii. the other player goes to step 1. b. a roll of 2-6 is added to the pot. 2. user can choose to hold or roll again. a. choice roll. return to step 1. b. choice hold. i. increment player score by the pot amount. ii. pot gets set to 0. iii. second player gets to roll and goes to step 1. program requirements: ● before each opponent begins ○ output the score for the person and the computer. ○ output the opponents whose turn is beginning and ask the user to hit enter to continue. ● with each dice roll. ○ output the die value, and amount of the round pot. ○ if it’s the users roll ask if they want to roll again ( r ) or hold ( h ). your program should allow r, r, h or h as valid input. if input is anything else, ask the user again until valid input is obtained. ○ the ai will continue playing until the round pot is 20 or more. ● once a player’s score is greater or equal to 50 then they have won, it will no longer ask if they want to keep rolling the die or not. ● once there is a winner ○ score totals are output along with who the winner was. user or computer ○ player is asked if they want to play again y or n. valid input should be y, y, or n, n. ● when a new game starts the starting roll goes to the player that did not roll last. if the user rolled last in the previous game, then the computer rolls first and vice versa. when the program first begins, the player will make the first roll of the first game. development notes : ● you will need a way to roll dice in your program. the rand() function works well, but returns an integer. if we want numbers 0 – 9 we can get the value modulus 10. ● call srand() with a value to seed it. it’s common to seed it with the current computer clock, include ctime, and then call srand(time(
Answers: 1
question
Computers and Technology, 23.06.2019 01:00
Let r be a robotic arm with a fixed base and seven links. the last joint of r is a prismatic joint, the other ones are revolute joints. give a set of parameters that determines a placement of r. what is the dimension of the configuration space resulting from your choice of parameters?
Answers: 3
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
question
Social Studies, 09.07.2021 06:40
question
Mathematics, 09.07.2021 06:40
question
Mathematics, 09.07.2021 06:50