I've just implemented move generator for my new xiangqi engine:
https://github.com/maksimKorzh/wukong-x ... /wukong.js
This was incredibly fun experience but surprisingly it wasn't trivial to get decent perft reults
as well as an engine to calibrate those results' accuracy by. But anyway I wanted to share
the perft results I found so far - one for initial positions and other for what I call Xiangqi Kiwipete equivalent:
Code: Select all
rnbakabnr/9/1c5c1/p1p1p1p1p/9/9/P1P1P1P1P/1C5C1/9/RNBAKABNR w - - 0 1
depth nodes checks captures
1 44 0 2
2 1920 6 72
3 79666 384 3159
4 3290240 19380 115365
5 133312995 953251 4917734
6 5392831844
r1ba1a3/4kn3/2n1b4/pNp1p1p1p/4c4/6P2/P1P2R2P/1CcC5/9/2BAKAB2 w - - 0 1
depth nodes checks captures
1 38 1 1
2 1128 12 10
3 43929 1190 2105
4 1339047 21299 31409
5 53112976 1496697 3262495
without grabbing it from other engines. I used mapping of piece codes to colors and types instead of
using bits to encode them within a piece itself - maybe not the fastest solution but at least no worth then my recent optimized WukongJS.
Anyway it's highly didactic so it would be truly trivial to understand how it works.
Guys you just probably can't ever imagine how happy and excited I am!
I didn't feel that happy when passed perft tests for chess for the first long time ago.
EDIT:
If you want to play around with it - just clone the source and run /src/gui/xiangqi.html in your browser.
Open devtools and perft would be there.
EDIT2:
To Gerd Isenberg:
Maybe you could add these 2 positions into CPW?
For now page for Chinese chess perft seems to be vacant.
EDIT3:
Ahhh... I thought I'm posting it to tech discussions...
Can moderators please move it to tech discussion?