Created
April 11, 2014 19:12
-
-
Save kastner/10493400 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
suits = %w| ⚫️ ⚪️ 🔴 🔵|.reverse | |
suits = %w|♦️ ️♣ ️♥️ ♠️|.reverse | |
nums = ["A"] + (2..9).to_a + %w|* J Q K| | |
cards = suits.map {|s| nums.collect {|i| "%s %s " % [i, s]}.reverse}.flatten | |
# cards = (1..52).map {|i| "%02d " % i} | |
puts cards.length | |
puts cards.join("|") | |
mid = cards.length / 2 | |
# puts cards[0..mid].zip(cards[mid+1..-0]).join("|") | |
8.times do |i| | |
puts "---" | |
puts "#{i+1} - middle: #{cards[mid]}" | |
puts "---" | |
cards = cards[0..mid-1].zip(cards[mid..cards.length-1]).flatten | |
# puts cards.inspect | |
puts cards.join("|") | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment