Manual Chess game
- Shule
- Reactions:
- Posts: 3392
- Joined: Thu Dec 12, 2019 3:29 pm
- Location: SW Idaho, USA
Manual Chess game
If anyone here is into abstract strategy games, I'm doing a Chess app in Python. It's manually controlled (with no game logic whatsoever), just like a regular board. The reason for this is to allow you to play whatever Chess variants you want instead of just the ones that are programmed into the game. This is to help people invent new Chess variants. You could play checkers or whatever, too. I use it to play against myself.
There are no images at the moment. You just drag and drop letters that represent your pieces.
Complete board customization and network play isn't set up yet, but I intend to add those features.
The source code gives you a list of features and how to use them in the main multi-line comment at the top.
Here's the code (it's just one Python file, and it doesn't use any third-party modules):
Press s to shuffle the pieces. Press r to reset. Press p to check for updates. Press a to switch the board style. Press f to flip the board. Drag and drop pieces to move them. Moving them onto other pieces will remove the other pieces. Double-clicking a piece will remove it. Right-clicking a tile will change its color (if you want more colors, you can add them in the code easily). You can drag new pieces from the panels.
If you're wondering about why I added that feature it's because I made some games that involve having quarters on the board. So, the colors represent different sides of the quarter. Plus, it's for making more games that involve stuff like that.
The score labels at the top are for games that involve a score (not particularly for regular Chess, unless you play a lot of rounds). They're to keep track of things. Press l, u, and L, U to modify the score.
F11 will toggle fullscreen mode on/off.
Oh, if you don't like the color scheme, feel free to change it (lines 80 and 81 on version 0.6.1). You can add more right-click colors on line 53 (or you can take colors away); the primary reason to reduce the number of colors is if you only use one color and don't want to click more times than necessary to make it the default color again.
There are no images at the moment. You just drag and drop letters that represent your pieces.
Complete board customization and network play isn't set up yet, but I intend to add those features.
The source code gives you a list of features and how to use them in the main multi-line comment at the top.
Here's the code (it's just one Python file, and it doesn't use any third-party modules):
Press s to shuffle the pieces. Press r to reset. Press p to check for updates. Press a to switch the board style. Press f to flip the board. Drag and drop pieces to move them. Moving them onto other pieces will remove the other pieces. Double-clicking a piece will remove it. Right-clicking a tile will change its color (if you want more colors, you can add them in the code easily). You can drag new pieces from the panels.
If you're wondering about why I added that feature it's because I made some games that involve having quarters on the board. So, the colors represent different sides of the quarter. Plus, it's for making more games that involve stuff like that.
The score labels at the top are for games that involve a score (not particularly for regular Chess, unless you play a lot of rounds). They're to keep track of things. Press l, u, and L, U to modify the score.
F11 will toggle fullscreen mode on/off.
Oh, if you don't like the color scheme, feel free to change it (lines 80 and 81 on version 0.6.1). You can add more right-click colors on line 53 (or you can take colors away); the primary reason to reduce the number of colors is if you only use one color and don't want to click more times than necessary to make it the default color again.
Location: SW Idaho, USA
Climate: BSk
USDA hardiness zone: 6
Elevation: 2,260 feet
Climate: BSk
USDA hardiness zone: 6
Elevation: 2,260 feet
- Shule
- Reactions:
- Posts: 3392
- Joined: Thu Dec 12, 2019 3:29 pm
- Location: SW Idaho, USA
Re: Manual Chess game
Here's a web version you can play just by clicking this link.
The shortcuts are a little different:
Modify the score with w, s, i, and k; h to shuffle; f to flip.
To remove a piece you either have to put another piece over it or hold control and click on a piece.
There's currently only one board size.
This one has actual Chess pieces instead of letters.
Just like the Python version, it's only one file, with no images (the Chess pieces are actually Unicode characters: ♔♕♖♗♘♙♚♛♜♝♞♟).
RIght-clicking still changes the tile color, of course.
It doesn't support touchscreens, yet.
The shortcuts are a little different:
Modify the score with w, s, i, and k; h to shuffle; f to flip.
To remove a piece you either have to put another piece over it or hold control and click on a piece.
There's currently only one board size.
This one has actual Chess pieces instead of letters.
Just like the Python version, it's only one file, with no images (the Chess pieces are actually Unicode characters: ♔♕♖♗♘♙♚♛♜♝♞♟).
RIght-clicking still changes the tile color, of course.
It doesn't support touchscreens, yet.
Location: SW Idaho, USA
Climate: BSk
USDA hardiness zone: 6
Elevation: 2,260 feet
Climate: BSk
USDA hardiness zone: 6
Elevation: 2,260 feet
- JRinPA
- Reactions:
- Posts: 2328
- Joined: Sat Jun 13, 2020 1:35 pm
- Location: PA Dutch Country
Re: Manual Chess game
It has been a while since I did anything with python. Got to be 10 years. Must have been on XP.
You wrote this yourself?
I did not install. I used to some coding but more as a must do rather than a want to do. I did click the link. I can move stuff around. It doesn't restrict moves or anything. And I have to move both sides.
Works as a replacement for a physical board, basically?
It is much more than I can do, coding wise. Nicely done.
You wrote this yourself?
I did not install. I used to some coding but more as a must do rather than a want to do. I did click the link. I can move stuff around. It doesn't restrict moves or anything. And I have to move both sides.
Works as a replacement for a physical board, basically?
It is much more than I can do, coding wise. Nicely done.
- Shule
- Reactions:
- Posts: 3392
- Joined: Thu Dec 12, 2019 3:29 pm
- Location: SW Idaho, USA
Re: Manual Chess game
@JRinPA
> It has been a while since I did anything with python. Got to be 10 years. Must have been on XP.
Awesome!
> You wrote this yourself?
ChatGPT wrote most of it, but I guided ChatGPT into doing it, and I made some alterations. I've done more complex things than this in Python, but I don't usually do visual apps that engage the mouse (until now). So I decided to try programming with ChatGPT for the first time to see what I could come up with (without having to consult a bunch of documentation to learn new stuff).
> … I did click the link. I can move stuff around. It doesn't restrict moves or anything. And I have to move both sides.
> Works as a replacement for a physical board, basically?
Yes. It's supposed to be like a physical board where you have full control. The reason for this is so you can play Chess variants that aren't programmed into the game logic (since there is no game logic). Actually, I made up some games, and I made the app so I could play them on my computer (and so other people could, too). The changing tile colors and scoring are involved in those games.
> … Nicely done.
Thanks!
> It has been a while since I did anything with python. Got to be 10 years. Must have been on XP.
Awesome!

> You wrote this yourself?
ChatGPT wrote most of it, but I guided ChatGPT into doing it, and I made some alterations. I've done more complex things than this in Python, but I don't usually do visual apps that engage the mouse (until now). So I decided to try programming with ChatGPT for the first time to see what I could come up with (without having to consult a bunch of documentation to learn new stuff).
> … I did click the link. I can move stuff around. It doesn't restrict moves or anything. And I have to move both sides.
> Works as a replacement for a physical board, basically?
Yes. It's supposed to be like a physical board where you have full control. The reason for this is so you can play Chess variants that aren't programmed into the game logic (since there is no game logic). Actually, I made up some games, and I made the app so I could play them on my computer (and so other people could, too). The changing tile colors and scoring are involved in those games.
> … Nicely done.
Thanks!

Location: SW Idaho, USA
Climate: BSk
USDA hardiness zone: 6
Elevation: 2,260 feet
Climate: BSk
USDA hardiness zone: 6
Elevation: 2,260 feet
- Shule
- Reactions:
- Posts: 3392
- Joined: Thu Dec 12, 2019 3:29 pm
- Location: SW Idaho, USA
Re: Manual Chess game
FYI: It's a lot easier to get ChatGPT to do visual layouts in HTML/CSS/JavaScript than on a Tkinter Canvas in Python. The panels caused a lot of bugs, initially. There are still a couple minor bugs in the panels on the JavaScript version, but I think I can fix those pretty easily. I might do that on Monday or Tuesday. As a workaround to avoid the bugs, be sure not to place a new piece directly in the postion where the last piece you moved was (you can put it somewhere else and then put it there), and after a new game, move a piece before you add any new pieces to the board.
Location: SW Idaho, USA
Climate: BSk
USDA hardiness zone: 6
Elevation: 2,260 feet
Climate: BSk
USDA hardiness zone: 6
Elevation: 2,260 feet
- worth1
- Reactions:
- Posts: 18457
- Joined: Tue Dec 10, 2019 12:32 pm
- Location: 25 miles southeast of Waterloo Texas
Re: Manual Chess game
Chess made my head hurt.
I would rather untangle string.

I would rather untangle string.

Worth
25 miles southeast of Waterloo Texas.
You can't argue with a closed mind.
You might as well be arguing with a cat.
25 miles southeast of Waterloo Texas.
You can't argue with a closed mind.
You might as well be arguing with a cat.
- JRinPA
- Reactions:
- Posts: 2328
- Joined: Sat Jun 13, 2020 1:35 pm
- Location: PA Dutch Country
Re: Manual Chess game
I have been known to untangle string for fun...
- Shule
- Reactions:
- Posts: 3392
- Joined: Thu Dec 12, 2019 3:29 pm
- Location: SW Idaho, USA
Re: Manual Chess game
Do you like Checkers? I should make a button or menu item to set up the pieces for checkers. Or I could make it so you could save/load your own setups.
Chinese Checkers is pretty fun, but I haven't set this up for that.
Have you tried Arimaa? Depending on your brain, it'll probably be either less of a headache or more of a headache than Chess. It's designed to be easier for humans but harder for computers. It requires less memorization, and movements allow more freedom, but there are more possible moves per turn than in Chess, and the mechanics are more complicated in some ways. I mean, you can push/pull/freeze/support pieces. All the pieces move the same way (except pawns, or rabbits as they're called, can't move backwards), but some pieces are stronger than others (cats are stronger than rabbits; dogs are stronger than cats; horses are stronger than dogs, camels are stronger than horses, elephants are stronger than camels). So, nothing can push, pull, or freeze an elephant, and an elephant can push and pull whatever it wants, except the other elephant. You win by getting a rabbit to the other side. You only eliminate pieces by pushing them into holes unsupported. If your piece is next to one of your own pieces, it's considered supported. If you're in a hole unsupported, you're captured. If you're next to a stronger enemy piece unsupported, you can't move your piece. You can only move and support in orthogonal (opposite of diagonal) directions. You can move up to four orthogonal spaces between all of your pieces per turn. It takes two of those four movements to push or pull a piece (one to move it and one to move your piece with it).
Location: SW Idaho, USA
Climate: BSk
USDA hardiness zone: 6
Elevation: 2,260 feet
Climate: BSk
USDA hardiness zone: 6
Elevation: 2,260 feet
- worth1
- Reactions:
- Posts: 18457
- Joined: Tue Dec 10, 2019 12:32 pm
- Location: 25 miles southeast of Waterloo Texas
Re: Manual Chess game
I forgot all about Chinese checkers.Shule wrote: ↑Mon Oct 28, 2024 10:09 pmDo you like Checkers? I should make a button or menu item to set up the pieces for checkers. Or I could make it so you could save/load your own setups.
Chinese Checkers is pretty fun, but I haven't set this up for that.
Have you tried Arimaa? Depending on your brain, it'll probably be either less of a headache or more of a headache than Chess. It's designed to be easier for humans but harder for computers. It requires less memorization, and movements allow more freedom, but there are more possible moves per turn than in Chess, and the mechanics are more complicated in some ways. I mean, you can push/pull/freeze/support pieces. All the pieces move the same way (except pawns, or rabbits as they're called, can't move backwards), but some pieces are stronger than others (cats are stronger than rabbits; dogs are stronger than cats; horses are stronger than dogs, camels are stronger than horses, elephants are stronger than camels). So, nothing can push, pull, or freeze an elephant, and an elephant can push and pull whatever it wants, except the other elephant. You win by getting a rabbit to the other side. You only eliminate pieces by pushing them into holes unsupported. If your piece is next to one of your own pieces, it's considered supported. If you're in a hole unsupported, you're captured. If you're next to a stronger enemy piece unsupported, you can't move your piece. You can only move and support in orthogonal (opposite of diagonal) directions. You can move up to four orthogonal spaces between all of your pieces per turn. It takes two of those four movements to push or pull a piece (one to move it and one to move your piece with it).
I don't like regular checkers at all.
My favorite board game is one called pente.
Next is dominos but it's not really a board game.
I used to have a domino partner that was a girl I went to school with.
My father and her stepdad were the other two we played against.
Her name was Juanita but German.
We played at least twice a week.
Worth
25 miles southeast of Waterloo Texas.
You can't argue with a closed mind.
You might as well be arguing with a cat.
25 miles southeast of Waterloo Texas.
You can't argue with a closed mind.
You might as well be arguing with a cat.