Skip to content

Instantly share code, notes, and snippets.

View daviddavis's full-sized avatar

David Davis daviddavis

View GitHub Profile
# Solution to #{problem.title}
# by david
# http://lh:3000/problems/blackjack
def twenty_one?(*cards)
21 == cards.inject(:+)
end
# Solution to #{problem.title}
# by david
# http://lh:3000/problems/blackjack
def twenty_one?(*cards)
21 == cards.inject(:+)
end
# Solution to #{problem.title}
# by david
# http://lh:3000/problems/blackjack
def twenty_one?(*cards)
21 == cards.inject(:+)
end
# Solution to #{problem.title}
# by david
# http://lh:3000/problems/blackjack
def twenty_one?(*cards)
21 == cards.inject(:+)
end
# Solution to #{problem.title}
# by david
# http://lh:3000/problems/blackjack
def twenty_one?(*cards)
21 == cards.inject(:+)
end
# Solution to #{problem.title}
# by david
# http://lh:3000/problems/blackjack
def twenty_one?(*cards)
21 == cards.inject(:+)
end
# Solution to #{problem.title}
# by david
# http://lh:3000/problems/blackjack
def twenty_one?(*cards)
21 == cards.inject(:+)
end
# Solution to #{problem.title}
# by david
# http://lh:3000/problems/blackjack
def twenty_one?(*cards)
21 == cards.inject(:+)
end
# Solution to 'The Curious Case of the Missing Method Part 3' on rubeque.com
# by david
# http://lh:3000/problems/the-curious-case-of-the-missing-method-part-3
a1 = [1, 2, 3]
a2 = [2, 3, 4]
b1 = ["durham", "bartow", "zwolle"]
b2 = ["nc", "fl", "nl"]
assert_equal a1.zip(a2), [[1, 2], [2, 3], [3, 4]]
# Solution to 'The Curious Case of the Missing Method Part 3' on rubeque.com
# by david
# http://lh:3000/problems/the-curious-case-of-the-missing-method-part-3
a1 = [1, 2, 3]
a2 = [2, 3, 4]
b1 = ["durham", "bartow", "zwolle"]
b2 = ["nc", "fl", "nl"]
assert_equal a1.zip(a2), [[1, 2], [2, 3], [3, 4]]