I have (hopefully) solved the castling problem, I added code that store and place back the values of w_cas and b_cas.
Good work, seems to be case - latest version now solves 'KiwiPete' perft test I posted previously - interesting fix references w_cas & b_cas which are the actual castling rights - from that test failure it seemed a problem with the castling permissions in search (ie w_casflags etc) - anyway now all seems to work fine.
I have also replaced the incheck() and attack() routines it takes 2k extra but is much faster then the old code.
Nice code!
If you have time you should have a look to at the make_move and unmake_move routines, unmake "unmakes" more things than "make" makes.
I've had a look but not sure what you mean here - what is the problem?
I also came across a problem with the 3-fold repetition routine.
Yes, well spotted - there is a small problem in some cases (don't know if you noticed - I never included checking for castling and ep conditions in the repetition tests - 3 fold rep requires everything in board state to be the same. 3 Fold repetition is notoriously difficult to get right for computer programs (and GUI in some cases for that matter) and many seem to get it wrong and/or interpret it differently. (Arena sometimes flags Numpty for this - I think wrongly). The winboard protocol handling conditions were updated to better clarify how this should be handled after I developed the code in Numpty - it was always something I meant to go back to and review - so perhaps I should do now.
New version of my version of NoMega
Many thanks for the latest version - certainly seems to be a little faster (c10%) - I have been busy this week but managed to give it 500 game also against original Numpty DD - results not so good this time (though 500 is still small sample):
1: Numpty_DD 253.5/500
2: Nomega140318 246.5/500
14 time losses - 11 for Nomega140318 and 3 for Numpty_DD (these were for 3 rep issue above). There was also 1 loss by Nomega due to rule infraction - game is below
[Event "New nomega test6"]
[Site "MY-PC"]
[Date "2014.03.19"]
[Round "88"]
[White "Nomega140318"]
[Black "Numpty_DD"]
[Result "0-1"]
[BlackElo "2200"]
[ECO "D00"]
[Opening "Queen's Pawn"]
[Time "10:48:08"]
[Variation "2.c3 Nf6 3.Bf4"]
[WhiteElo "2200"]
[TimeControl "60/60:60/60:60/60"]
[Termination "rules infraction"]
[PlyCount "62"]
[WhiteType "program"]
[BlackType "program"]
1. d4 Nf6 2. c3 d5 3. Bf4 Bf5 4. Qb3 Qc8 5. e3 e6 6. Nf3 Bd6 7. Bb5+ Nbd7
8. Bxd6 cxd6 9. e4 Ke7 10. exf5 exf5 11. O-O Rd8 12. Nbd2 Kf8 13. c4 dxc4
14. Nxc4 d5 15. Qb4+ Kg8 16. Nd6 a5 17. Nxc8 axb4 18. Ne7+ Kf8 19. Nxf5 Ra5
20. Bd3 Rda8 21. Bb1 b3 22. a3 Kg8 23. Nd6 R5a7 24. Nd2 Rd8 25. Nf5 Re8 26.
Bd3 Raa8 27. Nd6 Re6 28. Nxb7 Rb8 29. Nc5 Reb6 30. Rfe1 h5 31. Re7 Kf8
{Arena Adjudication. Illegal move!} 0-1
Not yet had chance to work this game yet and find the reason for the termination.