in reply to What I am missing here
Riales is spot-on; using Data::Dumper to dump out @deck at several places will show this quickly enough.
As an aside, I spotted another issue when I was looking at this, and couldn't run it as-shown. There's some needless complexity in sub deck_maker, which I simplified to this:
#DECK MAKER sub deck_maker { my @deck = (); #the deck for returning my @types = ('spades', 'hearts', 'diamonds', 'clubs'); my @cards = ( 2,3,4,5,6,7,8,9,10,'J','Q','K','A'); for ( my $i=0; $i < 4; $i++) { for ( my $j=0; $j < 13; $j++) { my $newcard = $cards[$j] . " of " . $types[$i]; push(@deck, $newcard); } } return @deck; #return the new deck }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: What I am missing here
by MidLifeXis (Monsignor) on Mar 20, 2012 at 20:22 UTC | |
by tobyink (Canon) on Mar 20, 2012 at 21:31 UTC | |
by heatblazer (Scribe) on Mar 21, 2012 at 05:21 UTC | |
by tobyink (Canon) on Mar 23, 2012 at 22:44 UTC | |
by heatblazer (Scribe) on Mar 21, 2012 at 05:17 UTC | |
by heatblazer (Scribe) on Mar 21, 2012 at 05:28 UTC |