Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: TMTOWTDI Puzzle: Generating a range of numbers

by jynx (Priest)
on Dec 19, 2001 at 11:27 UTC ( #133042=note: print w/replies, xml ) Need Help??


in reply to TMTOWTDI Puzzle: Generating a range of numbers


How about a mysterious tack?

The first is my favorite, and doesn't remotely work under warnings or strict. The second is a recusive solution for fun. The third is the trivialization of both solutions.

#1 $$_=~/((((((((((.))))))))))/for length$"..length$"x($^F<<$^F).$"x$^ +F; print map$_.$",sort{chr($a)cmp chr($b)}grep!($|eq$_)&&/\d/,keys%:: #2 sub r{ ($_,$a)=@_;$;=join'',/(.)/,$_;print$",length;r($;,$a)if!(length$; +eq$a) } r$",length$"x($^F<<$^F).$"x$^F.$" #3 print $_ for length$"..length$"x($^F<<$^F).$"x$^F
Thanx for the fun,
jynx

update: d'oh, atcroft beat me to recursion...
update2: reformatted, hopefully it looks better

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://133042]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2016-09-27 01:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Extraterrestrials haven't visited the Earth yet because:







    Results (493 votes). Check out past polls.