develooper Front page | perl.golf | Postings from May 2002

Re: can someone please explain..

Thread Previous | Thread Next
From:
Marcelo E. Magallon
Date:
May 10, 2002 02:48
Subject:
Re: can someone please explain..
Message ID:
20020508190624.GB3024@ysabell.wh.vaih
>> Jasper McCrea <jasper@guideguide.com> writes:

 > -l print map/[3-9]/?'':/1/?$":'-',0..2x pop

 Cool, someone submitted something like my solution :-)

 The cantor set is the set of all the numbers whose base-3
 representation doesn't contain a "1" in them.  All you need is the set
 of all the numbers in base-3 representation between 0 and n, where n is
 function f of the level.  f(0) = 0, f(1) = 2, f(2) = 8, ...  in base-3
 this is f(0) = 0, f(1) = 2, f(2) = 22.  Now it should be obvious what
 the Perl program above is doing.

 Marcelo,
 who, sadly, had a really busy week

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About