Python Forum
Help in a Go game buttons
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help in a Go game buttons
Hello, I have already asked this in an other thread and I'm sorry to create a new one but no one answers, so could you please help me?

My question is: I created a simplified Go game on Python where the board is represented by a 6x6 matrix and your stones by "1" and the enemy's by "-1" in it. The rule is simple, circle the enemy, the first one to lose a stone/group of stones loses the game.

I wanted to create a graphic interface with Tkinter but I know very few about this despite watching some tutorials which never helped me for what I want to know.
I put 25 buttons on the graphic interface (for a 5x5 game, not 6x6 but there is a reason) and when I click on one of those, I would like a circle representing my stone to appear, while the button disappears, plus, if possible, a "1" to appear in the matrix (corresponding of course at the same coordinates).
That will be more annoying with the enemy's turn for it's the computer.

That must sound easy for you but I don't know how to do it.

Thank you for helping me.
Show what you have tried so far.
also, which tutorials and video's you have watched on tkinter.
Thank you for your answer
For now, I've only put buttons: (it's a screenshot of python)

and watched videos such as these

But there never mention something else than printing something

I won't ask to have someone do my work of course, but if you could advise me and tell me how to do it, that would be perfect.
The function that the button calls will have to be coded to do all of these things, i.e. replace the button with a stone picture, etc. An example of creating multiple buttons (16 is this case), and passing the button number to the callback function so it knows which button to use
Thank you very much for your answer, I really like the new interface.

But I have no idea how to put a command with this type of button. How can I? How do I call a specific button since I have not defined them with numbers such as "button3= Button(main,command=game)"?
Thank you
I think I shouldn't send a message right away but if someone has a solution, I'll gladly take it. Thank you

Forum Jump:

User Panel Messages

Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020