Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9172511
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:21:50+00:00 2026-06-17T16:21:50+00:00

I am trying to make a Tic Tac Toe game in Python using the

  • 0

I am trying to make a Tic Tac Toe game in Python using the Zellegraphics module. I want to use getMouse for mouse input but I am unable to figure out how to make getMouse to work on one cell of the board. I defined 9 different squares and what I want to do is that if the user clicks on one certain square, I want to draw the X or the O there. I can’t figure out how to do that, because as far as I know, getMouse only acts on the whole window.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T16:21:52+00:00Added an answer on June 17, 2026 at 4:21 pm

    If you have some X and Y coordinates in the window (let’s call them, say, window_x and window_y) and you want to get the coordinates on a grid (let’s call them grid_x, andgrid_y), and each grid cell has a width and height of grid_size, it is relatively easy to calculate grid_x and grid_y: simply integer divide (round down; in Python, that would be the // operator) window_x by grid_size to get grid_x. You can probably figure out grid_y.

    A 3x3 grid is labeled with (0, 0), (1, 0), (2, 0) on the first row, (0, 1), (1, 1), and (2, 1) on the second row, and so on. The width of a cell is labeled grid_size. A particular point is labeled as a red dot. The X and Y location of the point are labeled from the top left corner of the grid.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically i'm trying to make a tic-tac-toe game using C++ and SFML2 API. I
I am trying to make a Tic Tac Toe game in Silverlight that can
I am trying to make a tic-tac-toe program, and want to know how I
I am trying to make a really simple Tic-Tac-Toe game. I have stored values
I was trying to make Tic Tac Toe game for the monthly tutorial and
I have read a book and am trying to make a game of tic-tac-toe
I am trying to make tic tac toe using websockets running on glassfish. I've
So I am working on a ModelViewController tic-tac-toe game homework and I am trying
I am trying to make a Tic Tac Toe program with java swing, and
I'm trying make my first python app. I want make simple email sender form.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.