ChessUSA.com TalkChess.com
Hosted by Your Move Chess & Games
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Checkers Is Strongly-Solved for 8-pieces
Post new topic    TalkChess.com Forum Index -> Computer Chess Club: Programming and Technical Discussions Flat
View previous topic :: View next topic  
Author Message
Rein Halbersma



Joined: 22 May 2007
Posts: 671

PostPost subject: Re: Checkers Is Strongly-Solved for 8-pieces    Posted: Mon Feb 27, 2017 2:58 pm Reply to topic Reply with quote

Cardoso wrote:

Quote:
I don't think I could figure out how to code your multiple jump rule. Capturing the greatest number of pieces, it the most Queens if the piece counts are the same...that must have been hard to implement.
Yes it is more work, because on captures we must first follow the quantity rule and then the quality rule, but the worst is the long range multiple jumps, so my capture generation functions are more complex and a bit slower than in english checkers.


Multiple jump rules can be programmed rather straightforward. First, you need to write an operator== and operator< (in C++, in C you would write a function) to be able to compare moves. For international checkers, the only criterion is the number of captured pieces. So you need to store an integer and compare for two moves the expression:
Code:
m.num_captured_pieces()

For multi-criterion draughts variants it gets a little more complicated. Of course, operator== is easy, just logical-AND the various criterions. But it turns out that you can also use a std::tuple (C++11 library addition) that also makes it very easy to use operator<. E.g. for Spanish checkers, you store 2 extra ints and you compare the expression
Code:
std::make_tuple(m.num_captured_pieces(), m.num_captured_kings())

Now you can pass this tuple of two integers to operator== and operator< and the C++ library will call automatically a routine that does the right thing: first comparing the first criterion, then the second etc.

I also implemented this for the hardest draughts variant, Italian draughts, where there are 4 criterions for capture resolution. For each move, I store an extra int, bool, int and bitboard and use the expression
Code:

std::make_tuple(m.num_captured_pieces(), m.is_with_king(), m.num_captured_kings(), m.piece_order())

Here, the bitboard "piece_order" stores a 1 on index 63-i if the i-th captured piece was a king, and a 0 otherwise.

Then during capture generation, you have to keep the largest capture moves generated so far, and for each newly found capture move, you have to check whether it is smaller, equal or greater than the currently largest jump move. If it's smaller, you ignore it, if it's equal you add it, and if it's larger you remove the currently best moves and store the new one.
Back to top
View user's profile Send private message
Display posts from previous:   
Subject Author Date/Time
Checkers Is Strongly-Solved for 8-pieces Ed Trice Sun Feb 12, 2017 6:13 pm
      Re: Checkers Is Strongly-Solved for 8-pieces Gerd Isenberg Mon Feb 13, 2017 1:04 pm
            Re: Checkers Is Strongly-Solved for 8-pieces Sven Schüle Mon Feb 13, 2017 1:43 pm
                  Re: Checkers Is Strongly-Solved for 8-pieces Álvaro Begué Mon Feb 13, 2017 2:45 pm
            Re: Checkers Is Strongly-Solved for 8-pieces Vladimir Medvedev Mon Feb 13, 2017 1:52 pm
            Re: Checkers Is Strongly-Solved for 8-pieces Ed Trice Mon Feb 13, 2017 4:11 pm
                  Re: Checkers Is Strongly-Solved for 8-pieces Gerd Isenberg Mon Feb 13, 2017 7:46 pm
                        Re: Checkers Is Strongly-Solved for 8-pieces Ronald de Man Mon Feb 13, 2017 8:08 pm
                              Re: Checkers Is Strongly-Solved for 8-pieces Ed Trice Mon Feb 13, 2017 8:24 pm
                                    Re: Checkers Is Strongly-Solved for 8-pieces Ronald de Man Mon Feb 13, 2017 8:30 pm
                                          Re: Checkers Is Strongly-Solved for 8-pieces Sven Schüle Mon Feb 13, 2017 10:22 pm
                                                Re: Checkers Is Strongly-Solved for 8-pieces Ronald de Man Mon Feb 13, 2017 11:51 pm
                                                      Re: Checkers Is Strongly-Solved for 8-pieces Ed Trice Tue Feb 14, 2017 2:26 am
                                                            Re: Checkers Is Strongly-Solved for 8-pieces Álvaro Begué Tue Feb 14, 2017 2:42 am
                                          Re: Checkers Is Strongly-Solved for 8-pieces Ed Trice Tue Feb 14, 2017 12:02 am
                                                Re: Checkers Is Strongly-Solved for 8-pieces Dann Corbit Tue Feb 14, 2017 12:26 am
                                                      Re: Checkers Is Strongly-Solved for 8-pieces Sven Schüle Tue Feb 14, 2017 9:57 am
                                                            Re: Checkers Is Strongly-Solved for 8-pieces Ed Trice Tue Feb 14, 2017 12:53 pm
                                                                  Re: Checkers Is Strongly-Solved for 8-pieces Sven Schüle Tue Feb 14, 2017 2:55 pm
                                                                        Re: Checkers Is Strongly-Solved for 8-pieces Ronald de Man Wed Feb 15, 2017 1:23 am
                                                                              Re: Checkers Is Strongly-Solved for 8-pieces Sven Schüle Wed Feb 15, 2017 12:36 pm
                                                                              Re: Checkers Is Strongly-Solved for 8-pieces J. Wesley Cleveland Wed Feb 15, 2017 6:08 pm
                                                                                    Re: Checkers Is Strongly-Solved for 8-pieces Ronald de Man Wed Feb 15, 2017 8:05 pm
                                                                        Re: Checkers Is Strongly-Solved for 8-pieces Ed Trice Wed Feb 15, 2017 4:11 am
                                                                              Re: Checkers Is Strongly-Solved for 8-pieces Sven Schüle Wed Feb 15, 2017 12:45 pm
                                                                  Re: Checkers Is Strongly-Solved for 8-pieces Rein Halbersma Tue Feb 14, 2017 3:13 pm
                                                                        Re: Checkers Is Strongly-Solved for 8-pieces Ed Trice Wed Feb 15, 2017 3:55 am
                                                                              Re: Checkers Is Strongly-Solved for 8-pieces Rein Halbersma Wed Feb 15, 2017 9:03 am
                                                                                    Re: Checkers Is Strongly-Solved for 8-pieces Ed Trice Wed Feb 15, 2017 2:50 pm
                                                                                    Re: Checkers Is Strongly-Solved for 8-pieces Ed Trice Wed Feb 15, 2017 2:50 pm
                                                                                          Re: Checkers Is Strongly-Solved for 8-pieces Rein Halbersma Wed Feb 15, 2017 7:20 pm
                                                                                          Re: Checkers Is Strongly-Solved for 8-pieces Ed Trice Thu Feb 16, 2017 4:38 am
                                                                                          Re: Checkers Is Strongly-Solved for 8-pieces Rein Halbersma Thu Feb 16, 2017 7:25 am
                                                                                    Re: Checkers Is Strongly-Solved for 8-pieces Ronald de Man Wed Feb 15, 2017 8:00 pm
                                                                                          Re: Checkers Is Strongly-Solved for 8-pieces Rein Halbersma Wed Feb 15, 2017 8:14 pm
                                                                                          Re: Checkers Is Strongly-Solved for 8-pieces Ronald de Man Wed Feb 15, 2017 8:31 pm
                                                                                    Re: Checkers Is Strongly-Solved for 8-pieces Ed Trice Thu Feb 16, 2017 4:20 am
                                                                                          Re: Checkers Is Strongly-Solved for 8-pieces Rein Halbersma Thu Feb 16, 2017 7:16 am
                                                                                          Re: Checkers Is Strongly-Solved for 8-pieces Ed Trice Thu Feb 16, 2017 8:23 am
                                                                                          Re: Checkers Is Strongly-Solved for 8-pieces Rein Halbersma Thu Feb 16, 2017 11:55 am
                                                                                          Re: Checkers Is Strongly-Solved for 8-pieces Sven Schüle Thu Feb 16, 2017 3:00 pm
                                                                                          Re: Checkers Is Strongly-Solved for 8-pieces Álvaro Begué Thu Feb 16, 2017 3:13 pm
                                                                                          Re: Checkers Is Strongly-Solved for 8-pieces Rein Halbersma Thu Feb 16, 2017 3:48 pm
                                                                                          Re: Checkers Is Strongly-Solved for 8-pieces Ed Trice Thu Feb 16, 2017 3:55 pm
                                                                                          Re: Checkers Is Strongly-Solved for 8-pieces Rein Halbersma Thu Feb 16, 2017 4:18 pm
                                                                                          Re: Checkers Is Strongly-Solved for 8-pieces Ronald de Man Thu Feb 16, 2017 7:27 pm
                                                                                          Re: Checkers Is Strongly-Solved for 8-pieces Ed Trice Thu Feb 16, 2017 9:47 pm
                                                                                          Re: Checkers Is Strongly-Solved for 8-pieces Ed Trice Sat Feb 18, 2017 5:23 am
                                                                                          Re: Checkers Is Strongly-Solved for 8-pieces Ronald de Man Sat Feb 18, 2017 3:58 pm
                                                                                          Re: Checkers Is Strongly-Solved for 8-pieces Ed Trice Sat Feb 18, 2017 4:49 pm
                                                                                          Re: Checkers Is Strongly-Solved for 8-pieces J. Wesley Cleveland Sat Feb 18, 2017 5:56 pm
                                                                                          Re: Checkers Is Strongly-Solved for 8-pieces Roch Manilla Sun Feb 19, 2017 12:32 am
                                                                                          Re: Checkers Is Strongly-Solved for 8-pieces Ed Trice Sun Feb 19, 2017 5:44 pm
                                                                                          Re: Checkers Is Strongly-Solved for 8-pieces Greg Simpson Sun Feb 19, 2017 9:04 pm
                                                                                          Re: Checkers Is Strongly-Solved for 8-pieces Rein Halbersma Sun Feb 19, 2017 9:27 pm
                                                                                          Re: Checkers Is Strongly-Solved for 8-pieces Greg Simpson Sun Feb 19, 2017 10:10 pm
                                                                                          Re: Checkers Is Strongly-Solved for 8-pieces Martin Sedlak Sun Feb 19, 2017 11:17 pm
                                                                                          Re: Checkers Is Strongly-Solved for 8-pieces Ed Trice Mon Feb 20, 2017 2:35 am
                                                                                          Re: Checkers Is Strongly-Solved for 8-pieces Ed Trice Mon Feb 20, 2017 5:31 am
                                                                                          Re: Checkers Is Strongly-Solved for 8-pieces Daniel Anulliero Mon Feb 20, 2017 8:21 am
                                                                                          Re: Checkers Is Strongly-Solved for 8-pieces Richard Delorme Mon Feb 20, 2017 2:13 pm
                                                                                          Re: Checkers Is Strongly-Solved for 8-pieces Jon Fredrik Åsvang Mon Feb 20, 2017 5:10 pm
                                                                                          Re: Checkers Is Strongly-Solved for 8-pieces Ed Trice Mon Feb 20, 2017 5:34 pm
                                                                                          Re: Checkers Is Strongly-Solved for 8-pieces Ed Trice Mon Feb 20, 2017 5:37 pm
                                                                                          Re: Checkers Is Strongly-Solved for 8-pieces Ed Trice Mon Feb 20, 2017 5:51 pm
                                                                                          Re: Checkers Is Strongly-Solved for 8-pieces Alvaro Cardoso Thu Feb 23, 2017 1:04 am
                                                                                          Re: Checkers Is Strongly-Solved for 8-pieces Ed Trice Thu Feb 23, 2017 6:14 pm
                                                                                          Re: Checkers Is Strongly-Solved for 8-pieces Alvaro Cardoso Thu Feb 23, 2017 11:52 pm
                                                                                          Re: Checkers Is Strongly-Solved for 8-pieces Ed Trice Fri Feb 24, 2017 4:19 am
                                                                                          Re: Checkers Is Strongly-Solved for 8-pieces Alvaro Cardoso Sat Feb 25, 2017 1:20 am
                                                                                          Re: Checkers Is Strongly-Solved for 8-pieces Ed Trice Sun Feb 26, 2017 4:56 am
                                                                                          Re: Checkers Is Strongly-Solved for 8-pieces Alvaro Cardoso Sun Feb 26, 2017 1:21 pm
                                                                                          Re: Checkers Is Strongly-Solved for 8-pieces Ed Trice Tue Feb 28, 2017 5:58 pm
                                                                                          Re: Checkers Is Strongly-Solved for 8-pieces Ed Trice Thu Mar 23, 2017 11:21 pm
                                                                                          Re: Checkers Is Strongly-Solved for 8-pieces Alvaro Cardoso Fri Mar 24, 2017 4:23 pm
                                                                                          Re: Checkers Is Strongly-Solved for 8-pieces Ed Trice Mon Mar 27, 2017 3:31 pm
                                                                                          Re: Checkers Is Strongly-Solved for 8-pieces Michael B Fri Mar 31, 2017 3:39 am
                                                                                          Re: Checkers Is Strongly-Solved for 8-pieces Ed Trice Thu Apr 06, 2017 10:10 pm
                                                                                          Re: Checkers Is Strongly-Solved for 8-pieces Rein Halbersma Mon Feb 27, 2017 2:58 pm
                                                                                          Re: Checkers Is Strongly-Solved for 8-pieces Ronald de Man Sat Feb 18, 2017 8:33 pm
                                                                                          Re: Checkers Is Strongly-Solved for 8-pieces Ed Trice Mon Mar 05, 2018 2:54 am
                                                                                          Re: Checkers Is Strongly-Solved for 8-pieces Rein Halbersma Mon Mar 05, 2018 7:23 am
                                                                                          Re: Checkers Is Strongly-Solved for 8-pieces Ronald de Man Mon Mar 05, 2018 4:34 pm
                                                                                          Re: Checkers Is Strongly-Solved for 8-pieces Rein Halbersma Mon Mar 05, 2018 5:18 pm
                                                                                          Re: Checkers Is Strongly-Solved for 8-pieces Ronald de Man Mon Mar 05, 2018 5:34 pm
                                                                                          Re: Checkers Is Strongly-Solved for 8-pieces Rein Halbersma Sat Feb 18, 2017 4:16 pm
                                                                                          Re: Checkers Is Strongly-Solved for 8-pieces Ed Trice Thu Feb 16, 2017 4:06 pm
                                                                                          Re: Checkers Is Strongly-Solved for 8-pieces Álvaro Begué Thu Feb 16, 2017 4:10 pm
                                                                                          Re: Checkers Is Strongly-Solved for 8-pieces Ed Trice Thu Feb 16, 2017 9:51 pm
                                                            Re: Checkers Is Strongly-Solved for 8-pieces Ronald de Man Wed Feb 15, 2017 1:10 am
                                                                  Re: Checkers Is Strongly-Solved for 8-pieces Sven Schüle Wed Feb 15, 2017 12:29 pm
                                                                        Re: Checkers Is Strongly-Solved for 8-pieces Ronald de Man Wed Feb 15, 2017 8:12 pm
                                                Re: Checkers Is Strongly-Solved for 8-pieces Álvaro Begué Tue Feb 14, 2017 2:43 am
                                                      Re: Checkers Is Strongly-Solved for 8-pieces Ed Trice Tue Feb 14, 2017 3:03 am
      Re: Checkers Is Strongly-Solved for 8-pieces Alvaro Cardoso Mon Feb 13, 2017 9:21 pm
            Re: Checkers Is Strongly-Solved for 8-pieces Ed Trice Mon Feb 13, 2017 11:50 pm
                  Re: Checkers Is Strongly-Solved for 8-pieces Ed Trice Tue Feb 14, 2017 2:08 am
      Re: Checkers Is Strongly-Solved for 8-pieces Krzysztof Grzelak Tue Feb 14, 2017 2:37 pm
            Re: Checkers Is Strongly-Solved for 8-pieces Ed Trice Sat Feb 17, 2018 7:16 pm
Post new topic    TalkChess.com Forum Index -> Computer Chess Club: Programming and Technical Discussions

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Powered by phpBB © 2001, 2005 phpBB Group
Enhanced with Moby Threads