Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. int negamax(game *g, int d){
  2. if(is_terminated(g) || d==0) return get_score(g);
  3. int scoreMin = -1000000;
  4. int sc2;
  5. int i;
  6. lstmove lst;
  7. list_moves(g,&lst,NULL);
  8. pmove *pTmp;
  9. for(i=0;i<size_lstmove(&lst);i++){
  10. pTmp = get_move(&lst,i);
  11. play_move(g, pTmp, 0);
  12. sc2 = - negamax(g, prof-1);
  13. if(sc2>sc)
  14. sc = sc2;
  15. cancel_move(g,pTmp);
  16. }
  17. return sc;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement