Skip to content

Instantly share code, notes, and snippets.

@Oshuma
Created November 13, 2008 16:59
Show Gist options
  • Save Oshuma/24497 to your computer and use it in GitHub Desktop.
Save Oshuma/24497 to your computer and use it in GitHub Desktop.
# Coin.flip # => 'heads' or 'tails'
class Coin
def self.flip
%w{heads tails}.sort_by {rand}.first
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment