3x3 chess

Endgame analysis using tablebases, EGTB generation, exchange, sharing, discussions, etc..
Post Reply
User avatar
jshriver
Posts: 298
Joined: Tue Jan 31, 2006 5:59 am
Sign-up code: 0
Location: Toledo, OH, USA
Contact:

3x3 chess

Post by jshriver »

Kinda OT, but wondered how did you solve the 3x3 chess and are there any engines or gui's that can play it for free, preferable to linux but can always use wine.

-Josh
User avatar
Kirill Kryukov
Site Admin
Posts: 7399
Joined: Sun Dec 18, 2005 9:58 am
Sign-up code: 0
Location: Mishima, Japan
Contact:

Post by Kirill Kryukov »

I'm not aware of any GUI or engine playing 3x3 chess. Only my web-site. The solution is simple because the whole database is just mere 300 MB, so it fits into memory easily. I did not use any tricks for compressing or indexing, only plain database. Simplest indexing scheme, and 1 byte per position.

I guess I could do a GUI and/or engine, but I don't really see why to do it. It is solved, so no need for engine, just look at the database. :-) The checkmate exercise can be probably improved on the web-site..

My real interest is solving variants of Shogi (Japanese chess), but at the moment I have very little time to do it..
User avatar
Kirill Kryukov
Site Admin
Posts: 7399
Joined: Sun Dec 18, 2005 9:58 am
Sign-up code: 0
Location: Mishima, Japan
Contact:

Re: 3x3 chess

Post by Kirill Kryukov »

Someone asked to see the 3x3 solver source code, so here it is.

Note. It's written in 2003 as a toy, so I did not take is seriously at all at the time. There is no automatic verification, no proper interface, basically it's primitive in every possible way. For the same reason it's also a horrible source - no structure, no comments, meaningless variable names, no thought given to clarity, efficiency or anything else. :oops:

If by any chance you'll have any usefull (or useless) feedback, please communicate it to me! Also please let me know if you find any bugs (which would not surprize me the slightest bit). If you'll ever decide to produce a derivative project (you are free and welcome to do so, however insane that might sound), I'd appreciate a note as well.

Enjoy! :D
Attachments
Kirr's 3x3 Chess Solver 1.0.0 - source.7z
(5.47 KiB) Downloaded 943 times
User avatar
Kirill Kryukov
Site Admin
Posts: 7399
Joined: Sun Dec 18, 2005 9:58 am
Sign-up code: 0
Location: Mishima, Japan
Contact:

Re: 3x3 chess

Post by Kirill Kryukov »

Erhan Cubukcuoglu notified me that he made a real physical 3x3 chess puzzle: Link. Looks very nice.

Image
Image
h.g.muller
Posts: 223
Joined: Mon Feb 19, 2007 8:24 am
Sign-up code: 0
Location: Amsterdam
Contact:

Re: 3x3 chess

Post by h.g.muller »

To Joshua:
WinBoard of course supports this (just set it to variant normal and 3 ranks, 3 files). I don't know any engines that play it, though. (And I could imagine an engine could play perfectly, being able to analyze to end-of-game from a given position.)

To Kirill:
Now you did 3x3 Chess, can you do 3x4 (Dobutsu) Shogi? It only has 8 pieces (while in 3x3 Chess you could have 9, and the material combinations are less restricted). So I could imagine the EGT would actually be smaller. Of course there is the complication that the holdings act as extra squares, so that the effective board size is 13, rather than 12. But in Chess the 'captured' state of a piece also acts as an extra square, leading to sub-end-games, while in Shogi all pieces are always present.
User avatar
Kirill Kryukov
Site Admin
Posts: 7399
Joined: Sun Dec 18, 2005 9:58 am
Sign-up code: 0
Location: Mishima, Japan
Contact:

Re: 3x3 chess

Post by Kirill Kryukov »

h.g.muller wrote:To Kirill:
Now you did 3x3 Chess, can you do 3x4 (Dobutsu) Shogi? It only has 8 pieces (while in 3x3 Chess you could have 9, and the material combinations are less restricted). So I could imagine the EGT would actually be smaller. Of course there is the complication that the holdings act as extra squares, so that the effective board size is 13, rather than 12. But in Chess the 'captured' state of a piece also acts as an extra square, leading to sub-end-games, while in Shogi all pieces are always present.
Hi H.G.,

Yes, I'm very interested in shogi variants. I solved one small board shogi variant years ago, and it's very interesting. As you note, chess is much simpler due to irreversible conversion between endgames, so recently I've been studying chess trying to improve my solvers. Eventually I hope to look into shogi again. (Although I've no idea when (or if) this will happen).

It looks like Dobutsu Shogi has been already solved, I am attaching the article in Japanese. Unfortunately I'm not aware of any English language report about it, also the database is not available (AFAIK).
h.g.muller wrote:Now you did 3x3 Chess
Sorry if you're aware, but in case if you're not: 3x3 chess was solved in 2004. Since then I also solved 3x4 chess (all up to 12 pieces) and a subset of 4x4 chess (up to 9 pieces so far).
Attachments
2009 Tanaka - Dobutsu Shogi (in Japanese).pdf
(143.97 KiB) Downloaded 1008 times
ernest
Posts: 63
Joined: Tue Nov 21, 2006 6:31 pm
Sign-up code: 0
Location: Paris

Re: 3x3 chess

Post by ernest »

Kirill Kryukov wrote:...and a subset of 4x4 chess (up to 9 pieces so far).
I hope that someday you'll get to 5x5 minichess!... :)
User avatar
Kirill Kryukov
Site Admin
Posts: 7399
Joined: Sun Dec 18, 2005 9:58 am
Sign-up code: 0
Location: Mishima, Japan
Contact:

Re: 3x3 chess

Post by Kirill Kryukov »

ernest wrote:
Kirill Kryukov wrote:...and a subset of 4x4 chess (up to 9 pieces so far).
I hope that someday you'll get to 5x5 minichess!... :)
Hi Ernest. What kind of questions do you hope to see answered in 5x5 chess? Some particular endgames or positions? I don't think the 20-piece starting position is easy to solve by tablebases alone (not soon anyway), but perhaps some other questions can be explored sooner.
ernest
Posts: 63
Joined: Tue Nov 21, 2006 6:31 pm
Sign-up code: 0
Location: Paris

Re: 3x3 chess

Post by ernest »

Kirill Kryukov wrote:What kind of questions do you hope to see answered in 5x5 chess?
Nothing in particular, Kirill, except that I enjoyed playing that game (through zillions-of-games) and that is the smallest chess with all pieces. And I am mainly interested in the variant with pawns on the 2nd and 4th rank, and symmetric pieces on the 1st and 5th.
Apparently, some opening theory was made in Italy.
So maybe solving it is the way Schaeffer did it with checkers, combining openings and endgame tables.
User avatar
Kirill Kryukov
Site Admin
Posts: 7399
Joined: Sun Dec 18, 2005 9:58 am
Sign-up code: 0
Location: Mishima, Japan
Contact:

Re: 3x3 chess

Post by Kirill Kryukov »

ernest wrote:Nothing in particular, Kirill, except that I enjoyed playing that game (through zillions-of-games) and that is the smallest chess with all pieces. And I am mainly interested in the variant with pawns on the 2nd and 4th rank, and symmetric pieces on the 1st and 5th.
Apparently, some opening theory was made in Italy.
So maybe solving it is the way Schaeffer did it with checkers, combining openings and endgame tables.
Yes, combining search and endgame tables it may be possible to solve it. I wonder if 10-piece tables are practical in 5x5.
User avatar
Kirill Kryukov
Site Admin
Posts: 7399
Joined: Sun Dec 18, 2005 9:58 am
Sign-up code: 0
Location: Mishima, Japan
Contact:

Re: 3x3 chess

Post by Kirill Kryukov »

New data: Number of unique legal positions (NULP) in 3x3 chess:

Code: Select all

Pieces      NULP
   2             5
   3           325
   4         9,309
   5       142,572
   6     1,277,268
   7     6,819,308
   8    20,282,213
   9    26,156,564
In total: 54,687,564.
User avatar
Kirill Kryukov
Site Admin
Posts: 7399
Joined: Sun Dec 18, 2005 9:58 am
Sign-up code: 0
Location: Mishima, Japan
Contact:

Re: 3x3 chess

Post by Kirill Kryukov »

Allen Lee sampled random selection of problems from the 3x3 chess web-site and assembled them into a nice looking PDF. With his kind permission I am attaching it here. It includes mates in 1, 2 and 3, 100 problems of each.
Attachments
300 MiniPuzzles.pdf
(10.39 MiB) Downloaded 716 times
Post Reply