Advertisement
Guest User

Untitled

a guest
Dec 17th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. def heuristique(self, b, etat):
  2. return 1
  3.  
  4.  
  5. def maxValue(self, b, etat, alpha, beta, profondeur=0):
  6. profondeur+=1
  7.  
  8. #eval heuristique
  9. if profondeur > 4:
  10. return heuristique(self, b, etat)
  11.  
  12.  
  13. for col in getPossibleColumns():
  14. alpha = max(alpha, minValue(self, b, alpha, beta))
  15. if alpha >= beta:
  16. return beta
  17. return alpha
  18.  
  19. def minValue(self, b, etat, alpha, beta, profondeur=0):
  20. profondeur += 1
  21.  
  22. #eval heuristique
  23. if profondeur > 4:
  24. return heuristique(self, b, etat)
  25.  
  26. for col in getPossibleColumns():
  27. beta = min(beta, maxValue(self, b, alpha, beta))
  28. if alpha >= beta:
  29. return beta
  30. return alpha
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement