Created
September 11, 2016 18:51
-
-
Save danielpowell4/a2a3e8cae1fbe1946345c91c351617a7 to your computer and use it in GitHub Desktop.
Price is right calculator in Ruby
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
# selecting | |
def choose_best_guess(ary) | |
ary.select{ |v| v <= t }.max | |
end | |
# rejecting | |
def choose_best_guess(ary) | |
ary.reject{ |v| v > t }.max | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment