Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(board[i][j]==0){
- board[i][j]=whomoves; //make the move onto the board
- if(lvl == 3)
- {
- nn->score_ = Eval(board, whomoves, i, j);
- return nn;
- }//undo the move...this is important
- nn->child_[i][j]=CreateTree(board,lvl+1,i,j, alpha, beta); //recursively create the //subtree
- nn->child_[i][j]->threat_ = Eval(board, -whomoves, i, j);
- nn->child_[i][j]->score_ = Eval(board, whomoves, i, j);
- board[i][j]=0;
- if(nn->child_[i][j]->score_ > beta)
- {
- beta = nn->score_;
- break;
- }
- if(nn->child_[i][j]->score_ < alpha && nn->child_[i][j]->score_ > beta)
- alpha = nn->score_;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement