Question
Please help on this assignment!!!! we need to use visual studio 2013 c++ programming. The backstory: After spending most of their money on 'tortas de
Please help on this assignment!!!! we need to use visual studio 2013 c++ programming.
The backstory: After spending most of their money on 'tortas de jamn', Don Ramn and El Chavo are ready to head home. They were wise enough to save some money for the bus tickets but since as you know they are very poor, they could not afford to buy a ticket for the 'atobus de lujo' (Deluxe bus) and had to settle for a 'guajolotero' bus (which stands for a bus that carries around 'guajolotes', the word used in Mxico to refer to turkeys).
While the Deluxe bus travels along a toll road and completes the trip to Mexico City in about 4 hours, the 'guajolotero' bus travels along a not-so-well-maintained highway and it could take up to 24 hours to complete the trip. Of course this is a long time and they will get really, really, really bored. If they only had a game or something that could help them pass the time... Y ahora, quin podr ayudarlos?
My 'chapulines', this is your assignment:
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.
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 'gato' every time the program is run. You will not know in advance whether the user wants to play 1 or 100 games and 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. You should loop the part of your code that performs the drawing rather than simply repeating your code multiple times.
What you do not have to do:
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 the O's and 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.
You are not responsible for deciding whether or not there is a winner.
Extra credit:
The following features of your program could result in extra credit on your homework score. I strongly suggest you get the basic program to work before attempting to implement any of these features. Neither I nor the TA's will give you any help with the extra credit.
(+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.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started