Skip to content

Instantly share code, notes, and snippets.

@ianbishop
Created May 10, 2012 22:49
Show Gist options
  • Select an option

  • Save ianbishop/2656416 to your computer and use it in GitHub Desktop.

Select an option

Save ianbishop/2656416 to your computer and use it in GitHub Desktop.
Symbol#to_proc ridiculousness
# Generate a poker hand
faces = (2..10).to_a + %w(J Q K A)
suits = %w(S C H A)
suits.product(faces).sample(5).map(&:join)
# => ["S7", "HA", "S8", "C4", "C8"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment