Python Forum

Full Version: Help in a Go game buttons
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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: https://ibb.co/j2uogJ (it's a screenshot of python)

and watched videos such as these
https://www.youtube.com/watch?v=eYtvp26asTE&t=147s
https://www.youtube.com/watch?v=sx0aUvHz3cI&t=1314s
https://www.youtube.com/watch?v=ddoPYppcppc&t=477s
https://www.youtube.com/watch?v=QPeS0TI0yNo

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 https://python-forum.io/Thread-Tkinter-T...ht=tkinter
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