Testing Legal Moves generator.

Discussion about development of draughts in the time of computer and Internet.
Post Reply
phil
Posts: 2
Joined: Sun Jul 08, 2012 22:10
Real name: phil tchao

Testing Legal Moves generator.

Post by phil » Sun Feb 17, 2013 00:58

Hello everybody,
I've just ending my move generator.
And in order to test it deeply, i'd like to know if exists a sample set of (position vs Legal Moves) somewhere in the web.
After a quick search on the forum, i found a link to this

https://bitbucket.org/rhalbersma/dctl/s ... at=gcc-dev

but what's i'm looking for is a set of hundreds or thousands of positions.

anyone?
thanks.

BertTuyt
Posts: 1592
Joined: Wed Sep 01, 2004 19:42

Re: Testing Legal Moves generator.

Post by BertTuyt » Sun Feb 17, 2013 12:34

Phil, you could use the Perft utility program approach.
See all the posts in this forum.
If (in the end) the node count for you MoveGenerator is the same as previous node count values, you might expect that your implementation is okish..

Bert

Rein Halbersma
Posts: 1722
Joined: Wed Apr 14, 2004 16:04
Contact:

Re: Testing Legal Moves generator.

Post by Rein Halbersma » Sun Feb 17, 2013 13:00

phil wrote:Hello everybody,
I've just ending my move generator.
And in order to test it deeply, i'd like to know if exists a sample set of (position vs Legal Moves) somewhere in the web.
After a quick search on the forum, i found a link to this

https://bitbucket.org/rhalbersma/dctl/s ... at=gcc-dev

but what's i'm looking for is a set of hundreds or thousands of positions.

anyone?
thanks.
Hi Phil,

The link you gave contains some positions from the Italian translation of the offical FMJD rules for 10x10 draughts. I tested this in my library, but it's indeed far from exhaustive. As Bert indicated, you could also use perft() on a few positions. On this forum, we mainly use 3 positions that Ed Gilbert started out with back in 2008. The perft() routine searches for about a dozen ply deep, and gets up to a few billion positions internally. It's a good check on your move generator's correctness, however, it's not a guarantee that it will test every nuance of the game rules. E.g. in Italian draughts, there is a very complicated majority capture precedence rule that is triggered only in very specific circumstances. To test that, just make your own unit tests (like the ones in the link you gave in your post) and test them separately.

Rein

Post Reply