On Jul 12, 10:33 am, [EMAIL PROTECTED] (Amichai Teumim) wrote:
> it's meant to
> print the top five cards (meanign the five cards that come first after the
> shuffling). Somethign like:
>
> 9 Heart 10 Heart J Heart Queen Heart King Heart 6 Diamonds
>
> This script prints out a whole bunch of stuff. What is wrong with it?

> for my $x (0 .. 99) {
>        my @shuffle = (
<snip>
>        );
>
>        push @startingdeck, @shuffle;
>
> print "@startingdeck[0 .. 4]\n";
> }


You have your print statement inside a loop that's executing 100
times.  Of course it's going to print "a whole bunch of stuff".  Just
because you didn't indent the print statement doesn't mean it's not in
the loop.  I don't know if that's what's confusing you or not.
Indentation is only used for code readability.  White space is not
significant in Perl.

Move your print statement outside the loop, that is, after the } that
ends the for loop.

Paul Lalli


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to