Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re: TMTOWTDI Puzzle: Generating a range of numbers

by atcroft (Monsignor)
on Dec 19, 2001 at 10:58 UTC ( #133036=note: print w/replies, xml ) Need Help??

in reply to TMTOWTDI Puzzle: Generating a range of numbers

My first attempt at one of the puzzles on here (I think someone had a suggestion similar to this). Thought it might be appropriate, though.

#!/usr/bin/perl -- -l -w my $msg = "happy b-day perl"; $msg =~ s/\s*|perl//g; &gen($msg); sub gen { my ($st) = @_; if (length($st)) { my @temp = split('', $st); shift(@temp); &gen(join('', @temp)); print(length($st), ' '); } }

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (7)
As of 2016-10-26 10:02 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (338 votes). Check out past polls.