Weekend programming challenge issue-8 solutions


Here are the Solutions for Issue#8, enjoy them! https://github.com/OLIMEX/WPC/tree/master/ISSUE-8

Although it seems simple on first sight this is really hard to implement for a weekend when you get into details, so congratulations to all who submitted solution!

The exotics this time is the solution written in linux shell language, I would never think this is possible before I saw it 🙂

8 Comments (+add yours?)

  1. kantal
    May 13, 2013 @ 21:04:07

    Just noticed, my Hangman-version a little bit different. I like the Bash-version 🙂


  2. Dylan
    May 14, 2013 @ 00:11:32

    My evil solution would have been to always ask for a three letter word, and always to go for the pattern consonant-vowel-consonant. The fifth vowel selected would be accepted, and for ‘U’ (least common) a further 13 consonants would be enough to beat the game, thus my 16 guesses.

    For any given dictionary of n-letter words, there clearly exists a strategy which maximizes the certainty of finding the hangman answer within m steps (m = 26 is an upper bound). Not quite as obviously, the longer the word, the lower m will be (there aren’t that many 12 letter words with only one vowel and none of TRNS.

    If, as is the case with vowels being exhausted, the evil hangman must choose to give “something” away, it would be interesting to know how large the dictionary of n-letter words needs to be for each number of wrong guesses.



  3. Dirk Porsche
    May 14, 2013 @ 15:32:18

    Well, too late (as always, my weekends are simply to packed). But for the interested, here is my solution:

    Try it: http://impossible-hangman.meteor.com
    The source: http://github.com/Crenshinibon/impossible-hangman

    The initial load might take some time. The app is simply unresponsive if the word list isn’t there yet. Could have included some loading-thingy. But I’m to lazy.


    • Dylan
      May 15, 2013 @ 02:49:15

      Love it!

      I failed to get a five letter word (one of the chosen ones was Ghyll, you foiled me, evil Porsche genius!), but Blutwurst I won on, with 5 fails (would be more had you not given the word away in browser).

      And above all, I love the graphics 🙂


      • Dirk Porsche
        May 15, 2013 @ 07:45:19

        Thanks. I did get the “Blutwurst” quite often either, I guess their is room for more improvement.

        I should randomly pick from the matching words array, not simply take the first one.

    • Emiliano Daddario
      May 15, 2013 @ 15:01:56

      Fantastic. I often win, my trick is to start with E,T,A,O,I,N,S.
      This is science: for the curious, look at “Letter frequency” on Wikipedia.


  4. ultimateohm
    May 18, 2013 @ 19:28:48


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: