Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //vereinfacht zT.
- inline bool IsKo(Position p, Color c) {
- Hash temphash=lasthash; //kopie machen
- temphash ^= hashVals[CPOS(p,c)]; //ich tu so, als ob ich position p spiele
- //all groups that are killed by this are xored in the hash
- FORADJ_DO( //für alle angrenzenden
- if(board[temp]==opposite[c] and GETBIT(atariCache, group[temp]) { //wenn diese gruppe getötet würde
- SETBIT(tempUsed, group[temp]);
- FORALLINGROUP_DO( //für all steine der gruppe
- temphash ^= hashVals[CPOS(git, board[git])]; //ich tu so, als ob ich die steine wegnehmen würde
- ,groups[group[temp]])
- }
- ,p,temp)
- for(int i=0; i<(historyWrap?HISTORY_SIZE : historySize); ++i) //jetzt hab ich den neuen hash
- if(temphash==history[i]) //ich schaue in der history nach, ob der schon vorkam.
- return true;
- return false;
- }
Add Comment
Please, Sign In to add comment