Advertisement
Guest User

bim=

a guest
Feb 26th, 2020
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. def Minmax(node, depth, Is_Max):
  2. if depth ==0 or node in terminal.keys():
  3. return terminal[node]
  4. if Is_Max:
  5. value = float('-inf')
  6. for child in dict[node]:
  7. print(child)
  8. value = max(value, Minmax(child, depth, 0))
  9. return value
  10. else:
  11. value = float('inf')
  12. for child in dict[node]:
  13. print(child)
  14. value = min(value, Minmax(child, depth, 1))
  15.  
  16. Minmax('A', float('inf'),1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement