Skip to content
Snippets Groups Projects
Commit 0c5530e5 authored by Brady James Garvin's avatar Brady James Garvin
Browse files

Provided solution to evaluate.

parent 0309dcbd
No related branches found
No related tags found
No related merge requests found
......@@ -68,7 +68,13 @@ def evaluate(heap_sizes):
>>> evaluate([9, 12, 3, 7])
<Evaluation.LOSS: 'LOSS'>
"""
return Evaluation.LOSS # Stub
if len(heap_sizes) > 1:
single_heap = convert_to_single_heap_using_builtin(heap_sizes[0],
heap_sizes[1])
return evaluate([single_heap] + heap_sizes[2:])
else:
return Evaluation.WIN if len(heap_sizes) == 0 or heap_sizes[0] == 0 \
else Evaluation.LOSS
def make_computer_move(position):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment