TalkChess.com
Hosted by Your Move Chess & Games

Author Message
Rein Halbersma

Joined: 22 May 2007
Posts: 671

Post subject: Re: Checkers Is Strongly-Solved for 8-pieces    Posted: Mon Feb 27, 2017 2:58 pm

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.
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First
Subject Author Date/Time
Ed Trice Sun Feb 12, 2017 6:13 pm
Gerd Isenberg Mon Feb 13, 2017 1:04 pm
Sven Schüle Mon Feb 13, 2017 1:43 pm
Álvaro Begué Mon Feb 13, 2017 2:45 pm
Vladimir Medvedev Mon Feb 13, 2017 1:52 pm
Ed Trice Mon Feb 13, 2017 4:11 pm
Gerd Isenberg Mon Feb 13, 2017 7:46 pm
Ronald de Man Mon Feb 13, 2017 8:08 pm
Ed Trice Mon Feb 13, 2017 8:24 pm
Ronald de Man Mon Feb 13, 2017 8:30 pm
Sven Schüle Mon Feb 13, 2017 10:22 pm
Ronald de Man Mon Feb 13, 2017 11:51 pm
Ed Trice Tue Feb 14, 2017 2:26 am
Álvaro Begué Tue Feb 14, 2017 2:42 am
Ed Trice Tue Feb 14, 2017 12:02 am
Dann Corbit Tue Feb 14, 2017 12:26 am
Sven Schüle Tue Feb 14, 2017 9:57 am
Ed Trice Tue Feb 14, 2017 12:53 pm
Sven Schüle Tue Feb 14, 2017 2:55 pm
Ronald de Man Wed Feb 15, 2017 1:23 am
Sven Schüle Wed Feb 15, 2017 12:36 pm
J. Wesley Cleveland Wed Feb 15, 2017 6:08 pm
Ronald de Man Wed Feb 15, 2017 8:05 pm
Ed Trice Wed Feb 15, 2017 4:11 am
Sven Schüle Wed Feb 15, 2017 12:45 pm
Rein Halbersma Tue Feb 14, 2017 3:13 pm
Ed Trice Wed Feb 15, 2017 3:55 am
Rein Halbersma Wed Feb 15, 2017 9:03 am
Ed Trice Wed Feb 15, 2017 2:50 pm
Ed Trice Wed Feb 15, 2017 2:50 pm
Rein Halbersma Wed Feb 15, 2017 7:20 pm
Ed Trice Thu Feb 16, 2017 4:38 am
Rein Halbersma Thu Feb 16, 2017 7:25 am
Ronald de Man Wed Feb 15, 2017 8:00 pm
Rein Halbersma Wed Feb 15, 2017 8:14 pm
Ronald de Man Wed Feb 15, 2017 8:31 pm
Ed Trice Thu Feb 16, 2017 4:20 am
Rein Halbersma Thu Feb 16, 2017 7:16 am
Ed Trice Thu Feb 16, 2017 8:23 am
Rein Halbersma Thu Feb 16, 2017 11:55 am
Sven Schüle Thu Feb 16, 2017 3:00 pm
Álvaro Begué Thu Feb 16, 2017 3:13 pm
Rein Halbersma Thu Feb 16, 2017 3:48 pm
Ed Trice Thu Feb 16, 2017 3:55 pm
Rein Halbersma Thu Feb 16, 2017 4:18 pm
Ronald de Man Thu Feb 16, 2017 7:27 pm
Ed Trice Thu Feb 16, 2017 9:47 pm
Ed Trice Sat Feb 18, 2017 5:23 am
Ronald de Man Sat Feb 18, 2017 3:58 pm
Ed Trice Sat Feb 18, 2017 4:49 pm
J. Wesley Cleveland Sat Feb 18, 2017 5:56 pm
Roch Manilla Sun Feb 19, 2017 12:32 am
Ed Trice Sun Feb 19, 2017 5:44 pm
Greg Simpson Sun Feb 19, 2017 9:04 pm
Rein Halbersma Sun Feb 19, 2017 9:27 pm
Greg Simpson Sun Feb 19, 2017 10:10 pm
Martin Sedlak Sun Feb 19, 2017 11:17 pm
Ed Trice Mon Feb 20, 2017 2:35 am
Ed Trice Mon Feb 20, 2017 5:31 am
Daniel Anulliero Mon Feb 20, 2017 8:21 am
Richard Delorme Mon Feb 20, 2017 2:13 pm
Jon Fredrik Åsvang Mon Feb 20, 2017 5:10 pm
Ed Trice Mon Feb 20, 2017 5:34 pm
Ed Trice Mon Feb 20, 2017 5:37 pm
Ed Trice Mon Feb 20, 2017 5:51 pm
Alvaro Cardoso Thu Feb 23, 2017 1:04 am
Ed Trice Thu Feb 23, 2017 6:14 pm
Alvaro Cardoso Thu Feb 23, 2017 11:52 pm
Ed Trice Fri Feb 24, 2017 4:19 am
Alvaro Cardoso Sat Feb 25, 2017 1:20 am
Ed Trice Sun Feb 26, 2017 4:56 am
Alvaro Cardoso Sun Feb 26, 2017 1:21 pm
Ed Trice Tue Feb 28, 2017 5:58 pm
Ed Trice Thu Mar 23, 2017 11:21 pm
Alvaro Cardoso Fri Mar 24, 2017 4:23 pm
Ed Trice Mon Mar 27, 2017 3:31 pm
Michael B Fri Mar 31, 2017 3:39 am
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
Ronald de Man Sat Feb 18, 2017 8:33 pm
Ed Trice Mon Mar 05, 2018 2:54 am
Rein Halbersma Mon Mar 05, 2018 7:23 am
Ronald de Man Mon Mar 05, 2018 4:34 pm
Rein Halbersma Mon Mar 05, 2018 5:18 pm
Ronald de Man Mon Mar 05, 2018 5:34 pm
Rein Halbersma Sat Feb 18, 2017 4:16 pm
Ed Trice Thu Feb 16, 2017 4:06 pm
Álvaro Begué Thu Feb 16, 2017 4:10 pm
Ed Trice Thu Feb 16, 2017 9:51 pm
Ronald de Man Wed Feb 15, 2017 1:10 am
Sven Schüle Wed Feb 15, 2017 12:29 pm
Ronald de Man Wed Feb 15, 2017 8:12 pm
Álvaro Begué Tue Feb 14, 2017 2:43 am
Ed Trice Tue Feb 14, 2017 3:03 am
Alvaro Cardoso Mon Feb 13, 2017 9:21 pm
Ed Trice Mon Feb 13, 2017 11:50 pm
Ed Trice Tue Feb 14, 2017 2:08 am
Krzysztof Grzelak Tue Feb 14, 2017 2:37 pm
Ed Trice Sat Feb 17, 2018 7:16 pm

 Jump to: Select a forum Computer Chess Club Forums----------------Computer Chess Club: General TopicsComputer Chess Club: Tournaments and MatchesComputer Chess Club: Programming and Technical DiscussionsComputer Chess Club: Engine Origins Other Forums----------------Chess Thinkers ForumChess Players ForumForum Help and Suggestions
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