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 08:10
Ihave a music player on my phone. i can buy songs, add them to playlists and play them. obviously it would be redundant to store each song in each playlist; each playlist is just a list of pointers to the songs. for this lab you will simulate this behavior. your program will need to have options to: add songs to the system library (you will store the text of the first line of the song, rather than the audio) add playlists add songs to a playlist list playlists play a playlist list all of the songs in the library with a count of how many times each song has been played remove a song from a playlist remove a playlist remove a song from the library (and thus from all playlists that contain it) note that we will not be checking many error cases. in real programming this would be bad, you should usually try to recognize and respond to as many types of errors as you can. in the context of class we are trying to acquaint you with as many concepts as possible, so for the sake of educational efficiency we will not be checking most errors in this lab, you may assume that your user provides correct input. you may add all appropriate error testing if you wish, but we will not be testing for it.
Answers: 2
question
Computers and Technology, 23.06.2019 02:30
How to launch an app: steps to be successful? launching an app is a great idea, but it’s not that easy as we supposed to think. the majority of mobile applications don’t generate revenue because companies aren’t ready to be competitive. referring to our experience in successfully building and launching apps we hope to you omit these difficulties. we are going to talk about ideas, marketing, testing your product, its development, distribution and support. you will learn 8 product launch stages to succeed.
Answers: 1
question
Computers and Technology, 23.06.2019 21:30
Write a fragment of code that reads in strings from standard input, until end-of-file and prints to standard output the largest value. you may assume there is at least one value. (cascading/streaming logic, basic string processing)
Answers: 3
question
Computers and Technology, 23.06.2019 21:30
Enzo’s balance sheet for the month of july is shown. enzo’s balance sheet (july 2013) assets liabilities cash $600 credit card $4,000 investments $500 student loan $2,500 house $120,000 mortgage $80,000 car $6,000 car loan $2,000 total $127,100 total $88,500 which expression finds enzo’s net worth?
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
question
Social Studies, 13.10.2019 13:10
question
Mathematics, 13.10.2019 13:10
question
Mathematics, 13.10.2019 13:10
Questions on the website: 13722361