Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def Minmax(node, depth, Is_Max):
- if depth ==0 or node in terminal.keys():
- return terminal[node]
- if Is_Max:
- value = float('-inf')
- for child in dict[node]:
- print(child)
- value = max(value, Minmax(child, depth, 0))
- return value
- else:
- value = float('inf')
- for child in dict[node]:
- print(child)
- value = min(value, Minmax(child, depth, 1))
- Minmax('A', float('inf'),1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement