ViliamVadocz/tak-perft
Quickly determine the number of positions at some depth in Tak.
cc5c6a5d71a317ed4b0ad776842d1d0655f72d0abe8d79d2d13c1af9acd47ecccf567e45f68b233331bd433201d12d6aa700074d751a7db4555cdb0dImplements perft for Tak in Zig.
I made this to learn Zig and to practice low-level optimizations.
zig build --release=fast./zig-out/bin/tak_perfttak_perft <depth:u8> [--tps <tps:str>]tak_perft --help to see the help message.").$ tak_perft 5
1253506520
$ tak_perft 5 --tps "x8/x8/x8/x8/x8/x8/x8/x8 1 1"
26642455192
$ tak_perft 6 --tps "x5/x5/2S,211C,2C,212S,x/x5/x5 1 7"
28289067995
$ tak_perft --help
=== Tak Perft ===
-h, --help Display this message and exit.
-t, --tps <str> Optional position given as TPS.
<u8> Specify the depth to search.
The TPS parsing is a little bit lenient. If the player to move is not provided, white is assumed. The move number is also unnecessary since we determine whether it is the opening based on the number of played stones.
The program only supports sizes 3 to 8 (inclusive).