dimanche 23 février 2014

Re: use strict; use warnings; topic




On 2014-02-24, Marek Novotny <(E-Mail Removed)> 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!





Aucun commentaire:

Enregistrer un commentaire