Privacy Policy moved to: https://can-i-buy-it-for-ynab.herokuapp.com/privacy
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
class Presents | |
def self.guess_gifts(wishlist, presents) | |
guess = [] | |
presents.each do |present| | |
wishlist.each do |wish| | |
if (wish.values - present.values).size == 1 | |
guess.push(wish[:name]) | |
end | |
end | |
end |
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
class Darts | |
def self.score_throws(arr) | |
sum = 0 | |
flag = true | |
arr.each do |dart| | |
if dart < 5 | |
sum += 10 | |
elsif dart <= 10 | |
sum += 5 |