in reply to A first attempt at obfuscation.
It's actually pretty readable once it's properly formatted (and once you've run it to see what it does). It runs fine with strict and warnings, too. I wasn't familiar with the use of "%*d" in sprintf.
We can interpret the ternary operators as being the equivalent of a C switch() statement. The first case of the switch() prints out the leading spaces needed to maintain the pyramid shape. The second case prints out the numbers from $! down to 1. The third case prints out the numbers from 2 up to $!. The fourth case prints the final newline. The default case prints nothing. |
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: A first attempt at obfuscation.
by Pic (Scribe) on Feb 22, 2005 at 00:24 UTC |