in reply to Re: Cube/digit script.
in thread Cube/digit script.
To me, this one looks more succinct, if a bit too much on one line ;-) But, to take this a bit further, I look at postfix "if" as "grep" ...
IMO, both better (more whitespace) and worse (hiding the loops, removal of parenthesis for the sum function). ;-) (I'm sure others have their own opinions of how they compare.)print map { "$_\n" } grep { $_ == sum map { $_ ** 3 } split // } 100 .. 999
Just to make it a bit worse ...
Or is that better? Hmmm...print "$_\n" for grep { $_ == sum map $_ ** 3, split // } 100 .. 999
|
|---|