Last active
April 24, 2019 09:02
-
-
Save ellehallal/ff12c1046d1d440bd25e84761275270e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def evaluate_move(depth, scores) | |
depth.zero? ? max_best_move(scores) : max_best_score(scores) | |
end | |
def max_best_move(scores) | |
scores.max_by { |_key, value| value }[0] | |
end | |
def max_best_score(scores) | |
scores.max_by { |_key, value| value }[1] | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment