bob wrote:cms271828 wrote:Thanks, I can see why being in check and zugzwang is bad for nmp.
I'm not sure if theres anything I need to do in MakeNullMove() and UndoNullMove(), and also where should I take the first null move, and how often should I use null move?
Thanks
The only thing you need to do is clear the enpassant target, of course. If I play a null-move after you play a move like e7-e5, I no longer have an opportunity to make an EP capture, so the hash signature needs to be corrected for that, assuming you are currently factoring this in to your signature. If course, as part of that the 50 move counter has to be reset, as you are making an "irreversable" move (actually an illegal move). Ditto for your repetition detection as you can't possibly repeat a position that occurred before the null-move.
Hello Bob,
(just didnt saw this post before...)
1.?
well if there isnt the opportunity any longer to make an EP capture, i agree
with you that the nullmove is considered as "irreversible" move.
Otherwise it would be reversable or not ? (And who defined that rule,or simple why ?)
(well, i think because epCapture must be done immediatelly as next
move on a doublePawnPush, implies no move (also no nullmove) can
be done without loosing the opportunity for epCapture) in between.
That would affirm your statement).
2.?
While the nullmove is neither a pawnMove nor a capture, one may argue
that the halfmoveclock has to be incremented (and not reset, you also
increment the treeheight,reduce depth... which influences the entries of the hashtable, and the result of the search ?!) .
A nullmove is at the end a placeholder for one of the regular moves available (which of course _can_ increment the counter) (considered as the weakest move).
At the moment i dont see a reason to reset the counter !?
(maybe there are some reasons).
3.?
And why you can not repeat a position on nullmove ? (i dont have
now in mind the case with epcapture).
ex: 1.move null 2. moveback null 3. repeatedPosition
when null is placeholder for a reversible move:
ex: 1. Nf3 (Nf6) 2. Ng1 (Ng8) 3. Nf3
Also not clear for me ?!
Michael