Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int negamax(game *g, int d){
- if(is_terminated(g) || d==0) return get_score(g);
- int scoreMin = -1000000;
- int sc2;
- int i;
- lstmove lst;
- list_moves(g,&lst,NULL);
- pmove *pTmp;
- for(i=0;i<size_lstmove(&lst);i++){
- pTmp = get_move(&lst,i);
- play_move(g, pTmp, 0);
- sc2 = - negamax(g, prof-1);
- if(sc2>sc)
- sc = sc2;
- cancel_move(g,pTmp);
- }
- return sc;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement