Guest User

Untitled

a guest
Jun 17th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. //vereinfacht zT.
  2.  
  3.  
  4.  
  5. inline bool IsKo(Position p, Color c) {
  6. Hash temphash=lasthash; //kopie machen
  7. temphash ^= hashVals[CPOS(p,c)]; //ich tu so, als ob ich position p spiele
  8.  
  9. //all groups that are killed by this are xored in the hash
  10. FORADJ_DO( //für alle angrenzenden
  11.  
  12. if(board[temp]==opposite[c] and GETBIT(atariCache, group[temp]) { //wenn diese gruppe getötet würde
  13. SETBIT(tempUsed, group[temp]);
  14. FORALLINGROUP_DO( //für all steine der gruppe
  15. temphash ^= hashVals[CPOS(git, board[git])]; //ich tu so, als ob ich die steine wegnehmen würde
  16. ,groups[group[temp]])
  17. }
  18. ,p,temp)
  19.  
  20. for(int i=0; i<(historyWrap?HISTORY_SIZE : historySize); ++i) //jetzt hab ich den neuen hash
  21. if(temphash==history[i]) //ich schaue in der history nach, ob der schon vorkam.
  22. return true;
  23.  
  24. return false;
  25. }
Add Comment
Please, Sign In to add comment