Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Word Unscrambler

by Posthumous (Scribe)
on May 03, 2006 at 15:58 UTC ( #547188=note: print w/ replies, xml ) Need Help??


in reply to Word Unscrambler

This is a late comment, but I hope not out of place.

My daughter and I were working on a Jumble puzzle with a word we just couldn't crack. So, of course, I decided to throw the Perl wrench at it. As I thought about the algorithm, regular expressions just seemed like a natural choice.

I have to say this solution amazed me (I admit it, I'm not an experienced or professionally educatued programmer). I mean look at: 12 lines! And the solution -- how clever! Rather than looking for a match, it eliminates non-matches. I've learned something here.

OK, so I needed to solve a jumble, not find all possibilities. Two quick changes to one line, and I'm off:

next unless ( length $word == $#ARGV + 2 );

Great post, great solution. Thanks jonnybe


Comment on Re: Word Unscrambler
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (14)
As of 2015-07-06 15:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (77 votes), past polls