Skip to content

Instantly share code, notes, and snippets.

@jmoon90
Last active December 29, 2015 11:09
Show Gist options
  • Select an option

  • Save jmoon90/7661474 to your computer and use it in GitHub Desktop.

Select an option

Save jmoon90/7661474 to your computer and use it in GitHub Desktop.
# Quick Challenge
class Card
def initialize(rank = nil, suit = nil)
if suit.nil?
@suit = ['♠', '♣', '♥', '♦'].sample
else
@suit = suit
end
if rank.nil?
@rank = ["2", "3","4","5","6","7","8","9","10","J","Q","K","A"].sample
else
@rank = rank
end
puts "Create a new card: #{@rank} of #{@suit}"
end
end
require "pry"
binding.pry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment