add some exercises

This commit is contained in:
julien committed 2026-10-13 20:33:50 +02:00
1 parent f6abf65e91
commit d79c543c72
13 files changed
+232

No files matched your search

+14
View File
@@ -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")