William Herrera skribis 2006-09-17 13:45 (-0600):
> Ruby (10 lines, 274 bytes)

This is the nicest example, so I'll base my response off this one.

    my @numbers = (1..9).sort:{ rand };
    my $steps = 0;
    while ("@numbers[]" ne "@numbers.sort()") {
        say "@numbers";
        my $flipcount = prompt "Reverse how many?";
    say "Done! That took you $steps steps.\n";

> Does perl6's Array class allow for more compact syntax, without 
> FreezeThaw.pm?

Interpolate the arrays:

    while ("@numbers" ne "@{[ sort @numbers ]}") { ... }

korajn salutojn,

  juerd waalboer:  perl hacker  <[EMAIL PROTECTED]>  <http://juerd.nl/sig>
  convolution:     ict solutions and consultancy <[EMAIL PROTECTED]>

Reply via email to