im getting ruby down and i like it so far,
but i need a lil helping out...
i got to make a deck of cards for hw ( so dont spoil the fun and figure it out for me, just push me in the right direction )
i have set up two arrays to combine on top of eachother to create each individual card.... as seen below
SUIT = %w[ heart, diamond, club, spade ] VALUE = %w[ 2, 3, 4, 5, 6, 7, 8, 9, 10, J, Q, K, A ] SUIT.each do |suit| VALUE.each do |value| puts value + suit end end
now, when this outputs does it make a new array that i can access or is there a way i can convert that into an array,
because somehow i need to get at these cards and then be able to shuffle the deck and draw random ones off the top.
thanks in advance.
here is the output from the part i have done :
This post has been edited by capty99: 07 September 2006 - 08:24 AM