In order to learn what is called? Is the object an array or hash created?
stack_of_cards = []
This is how I fill it:
stack_of_cards << Card.new("A", "Spades", 1) stack_of_cards << Card.new("2", "Spades", 2) stack_of_cards << Card.new("3", "Spades", 3) ...
Here is my map class:
class Card attr_accessor :number, :suit, :value def initialize(number, suit, value) @number = number @suit = suit @value = value end def to_s "#{@number} of #{@suit}" end end
I would like to shuffle the elements in this array / hash (what is called ?: S)
Any suggestions?
delete
source share