http://www.perlmonks.org?node_id=132971


in reply to TMTOWTDI Puzzle: Generating a range of numbers

Just a silly answer :). When men didn't have digits, they used fingers or sticks to count... ;-)

my @numbers = ( ['|'], ['|', '|'], ['|', '|', '|'], ['|', '|', '|', '|'], ['|', '|', '|', '|', '|'], ['|', '|', '|', '|', '|', '|'], ['|', '|', '|', '|', '|', '|', '|'], ['|', '|', '|', '|', '|', '|', '|', '|'], ['|', '|', '|', '|', '|', '|', '|', '|', '|'], ['|', '|', '|', '|', '|', '|', '|', '|', '|', '|'], ); foreach( @numbers ) { print scalar @$_; print "\n"; }

Replies are listed 'Best First'.
Re: Re: TMTOWTDI Puzzle: Generating a range of numbers
by Juerd (Abbot) on Dec 19, 2001 at 04:07 UTC
    I just couldn't resist it... When I saw they used fingers to count, I immediately thought of counting candles...
    my @numbers = ( ['|'] , ['|','|'] , ['|','|','|'] , ['|','|','|','|'] , ['|','|','|','|','|'] , ['|','|','|','|','|','|'] , ['|','|','|','|','|','|','|'] , ['|','|','|','|','|','|','|','|'] , ['|','|','|','|','|','|','|','|','|'] , ['|','|','|','|','|','|','|','|','|','|'] , ) ; foreach ( @numbers ) { print scalar @$_; print "\n"; }

    2;0 juerd@ouranos:~$ perl -e'undef christmas' Segmentation fault 2;139 juerd@ouranos:~$