>>>>> "Damian" == Damian Conway <[EMAIL PROTECTED]> writes:

Damian> Personally, I think:

Damian>         foreach my $x (1..99) {
Damian>         foreach my $y (1..99) {
Damian>         foreach my $z (1..99) {
Damian>                 print "$x, $y, $z\n" if $x**2 == $y**2 + $z**2;
Damian>         }}}
                
Damian> is much cleaner.

Or even

for my $x (1..98) {
  for my $y (1..(99-$x)) {
    for my $z (1..(100-$x-$y)) {
      print "$x, $y, $z\n" if $x ** 2 = $y ** 2 + $z ** 2;
    }
  }
}

Damian> But it certainly does demonstrate TMTOWTDI. ;-)

TMT2WTDI :-)

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

Reply via email to