Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^2: Hangman Assistant

by Lawliet (Curate)
on Jul 12, 2009 at 05:21 UTC ( [id://779310]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    # Find how close each letter is to half of the total word possibilitie
    +s to ensure maximum gain every guess after being sorted
    foreach my $occur (keys %alphabet) {
    ...
    say $_ foreach @narrowed; # Word list
    say $#narrowed + 1;
    say sort { $alphabet{$a} <=> $alphabet{$b} } keys %alphabet; # Sort as
    +cendingly; whichever letter is closest to 0, i.e., and therefore whic
    +hever letter will eliminate the most words.
    
  2. or download this
    $ perl hangman.pl "_ _ _ _ _ _ _ _" ""
    _ _ _ _ _ _ _ _
    ...
    phonetic
    4
    wraxdjyukhgftienvmslcpqbzo
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2024-04-23 08:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found