Re: use strict; use warnings;

Discussion in 'Perl Misc' started by Kaz Kylheku, Feb 24, 2014.

  1. Kaz Kylheku

    Kaz Kylheku Guest

    On 2014-02-24, Marek Novotny <> wrote:
    > Hi group,
    >
    > Tonight I finished up another obj for my class. The class has not yet
    > started to learn about use strict; and use warnings;
    >
    > I was given the following to solve:
    >
    > # Using pop, shift, push, and the starting code below, write a script
    > # that sufficiently "shuffles" a simulated deck of cards before printing

    ^^^^^^^^^^

    You implemented:

    > # sort the suits in reverse high order stating with ace, kings, etc.

    ^^^^
    >
    > my $i = 0;
    > while ($i < 51){
    > @sorted[$i] = pop(@hearts); $i++;
    > @sorted[$i] = pop(@diamonds); $i++;
    > @sorted[$i] = pop(@clubs); $i++;
    > @sorted[$i] = pop(@spades); $i++;
    > }


    Nice as it is, your program doesn't implement the requirement of shuffling!
     
    Kaz Kylheku, Feb 24, 2014
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Marius Gavrilescu

    Re: use strict; use warnings;

    Marius Gavrilescu, Feb 24, 2014, in forum: Perl Misc
    Replies:
    152
    Views:
    563
    $Bill
    Mar 11, 2014
  2. George Mpouras

    Re: use strict; use warnings;

    George Mpouras, Feb 24, 2014, in forum: Perl Misc
    Replies:
    0
    Views:
    64
    George Mpouras
    Feb 24, 2014
  3. Mart van de Wege

    Re: use strict; use warnings;

    Mart van de Wege, Feb 24, 2014, in forum: Perl Misc
    Replies:
    1
    Views:
    63
    Mart van de Wege
    Feb 25, 2014
  4. Justin C

    Re: use strict; use warnings;

    Justin C, Feb 24, 2014, in forum: Perl Misc
    Replies:
    2
    Views:
    87
    Justin C
    Feb 25, 2014
  5. Janek Schleicher

    Re: use strict; use warnings;

    Janek Schleicher, Feb 24, 2014, in forum: Perl Misc
    Replies:
    4
    Views:
    94
    $Bill
    Feb 25, 2014
Loading...

Share This Page