first commit
This commit is contained in:
commit
f6abf65e91
10 files changed
+346
No files matched your search
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env ruby
|
||||
|
||||
def cards_of_suit(cards, suit)
|
||||
cards.select { |card| card.include?(suit) }
|
||||
end
|
||||
|
||||
cards = [
|
||||
"7 of hearts",
|
||||
"king of clubs",
|
||||
"10 of hearts",
|
||||
"ace of spades"
|
||||
]
|
||||
|
||||
puts cards_of_suit(cards, "hearts")
|
||||
Reference in new issue
Block a user