“Moves” as user input via mouse clicks X always goes first Prompt the user to Click on a square
User Clicks on a Square
Place an X or O (as appropriate) in the selected square
After 9 moves, prompt user to click to Quit, then close window
The challenge in this assignment is in determining which square a user clicked on. Here are some hints: you should define the game board using coordinate transformation and the setCoords() method. Each user click returns a point with X & Y values. Can you relate those values to a specific square?

For this assignment, the 50 points for requirements are based on the following:

10 – Game board is correct
10 – uses setCoords()appropriately
10 – defined internal functions to modularize program
10 – X & O appear where they should when user clicks
10 – User prompts are correct
needs to be done in the python idle shell and must use graphics.py. All I really need is a copy of the source code so I can copy-paste it.
Needs to be done in python IDLE shell NOT normal python. Also needs graphics.py imported and used

Comments from Customer
You are going to write a program which provides a playing board for the game Tic-Tac-Toe. Here are the details:

Create a 3×3 game board
Accept 9 “Moves” as user input via mouse clicks
X always goes first
Prompt the user to Click on a square
User Clicks on a Square
Place an X or O (as appropriate) in the selected square
After 9 moves, prompt user to click to Quit, then close window
The challenge in this assignment is in determining which square a user clicked on. Here are some hints: you should define the game board using coordinate transformation and the setCoords() method. Each user returns a point with X & Y values. Can you relate those values to a specific square?

For this assignment, the 50 points for requirements are based on the following:

10 – Game board is correct
10 – uses setCoords()appropriately
10 – defined internal functions to modularize program
10 – X & O appear where they should when user clicks
10 – User prompts are correct
needs to be done in the python idle shell and must use graphics.py. All I really need is a copy of the source code so I can copy-paste it. It has to be done in python IDLE shell with graphics.py imported

Sample Solution

This question has been answered.

Get Answer