Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. if(board[i][j]==0){
  2. board[i][j]=whomoves; //make the move onto the board
  3. if(lvl == 3)
  4. {
  5. nn->score_ = Eval(board, whomoves, i, j);
  6. return nn;
  7. }//undo the move...this is important
  8. nn->child_[i][j]=CreateTree(board,lvl+1,i,j, alpha, beta); //recursively create the //subtree
  9. nn->child_[i][j]->threat_ = Eval(board, -whomoves, i, j);
  10. nn->child_[i][j]->score_ = Eval(board, whomoves, i, j);
  11. board[i][j]=0;
  12. if(nn->child_[i][j]->score_ > beta)
  13. {
  14. beta = nn->score_;
  15. break;
  16. }
  17. if(nn->child_[i][j]->score_ < alpha && nn->child_[i][j]->score_ > beta)
  18. alpha = nn->score_;
  19. }
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement