Created
January 2, 2019 20:12
-
-
Save gmacdougall/860e941393fe02c9d56d67f968c38a9d to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env ruby | |
ranks = %w[2 3 4 5 6 7 8 9 T J Q K A] | |
suits = %w[C D H S] | |
initial_deck = ranks.flat_map do |rank| | |
suits.map do |suit| | |
"#{rank}#{suit}" | |
end | |
end | |
10.times do | |
deck = initial_deck.shuffle | |
result = 6.times.map do |hand| | |
"#{deck.pop(5).join(' ')}" | |
end | |
puts result.join('|') | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment