#!/usr/bin/perl -l ;print $[ ;print not undef ;print chop if$_=ord$" ;print hex atan2 $#,$#: ;print ~~~~ split //=> four ;print oct$] ;print $=/ord$/ ;print length reverse => ;print sqrt oct ord double ;print ${}} =( )= localtime ;print !$,,$|

--
John.

Replies are listed 'Best First'.
Re: Eleven Easy Pieces.
by jmcnamara (Monsignor) on Jan 31, 2002 at 16:35 UTC

    This was inspired by Masem's Generating a range of numbers and Juerd's Counting backwards.

    You are invited to golf or obfuscate the numbers from 0 to 10 without using numbers. Each number must be generated by a single self contained statement and cannot rely on previous statements.

    Obfuscators, use art or artifice.

    Golfers, use a one-liner with -le and count from the prompt:

    #23456789_1234567 (17) perl -le'print$['

    You can use ord() but not on its own. This is to avoid a range of neat but trivial solutions.

    I think that solutions 0, 5, 6 and 10 above are minimal (with unnecessary whitespace and punctuation stripped). The function atan2() is allowed even though it contains a number. ;-)

    --
    John.