Weekend Programming Challenge Issue-8


Image

Problem:

Make All-winner Hangman game 🙂

Everybody knows Hangman game http://en.wikipedia.org/wiki/Hangman_(game) and it’s very easy to implement one even with ASCII art on the computer text terminal console, so we will not focus on fancy graphics in this challenge.

To generate the guess word you can use some free English word list, for instance from here: http://dreamsteep.com/projects/the-english-open-word-list.html which contains about 128,000 words.

The challenge this weekend is to make the computer unbeatable. How?
Each time the player guess letter, if this letter is in your word you have to scan the dictionary for similar word (if possible and do not break the game rules) which have no such letter and replace it, so player is always wrong 😀 .

 The rules:

You can code the solution in any programming language during the weekend and have to submit it to info@olimex.com latest on Sunday May 12th.

On Monday we will upload the solutions on GitHub and review https://github.com/OLIMEX/WPC .

You can play with your real name or with nick if you want to be anonymous, we will not disclosure your personal info if you do not want to.

Good Luck and Have fun!

13 Comments (+add yours?)

  1. Dirk Porsche
    May 10, 2013 @ 17:54:28

    I guess the program has to remember already tried letters and find new words where none of them is included?

    Reply

    • OLIMEX Ltd
      May 10, 2013 @ 17:59:10

      yes, absolutely, the game rules have to be not break as I wrote above, i.e. the new word should match the rules of the game if replace the old one

      Reply

    • Iain Cunningham (@IainIsm)
      May 10, 2013 @ 18:01:06

      That’s how I interpreted this – I only wish I knew a language that had good text parsing capabilities to be able to put an entry in!

      Reply

      • Dirk Porsche
        May 10, 2013 @ 22:50:05

        I will go with CoffeeScript again. But I’m not certain if I will find the time. The output bothers me a little more, with that language choice. I will take a look at some HTML5 canvas painting and show everything in the browser.

      • OLIMEX Ltd
        May 11, 2013 @ 07:50:14

        no need for painting, you can do it in text mode

      • Dirk Porsche
        May 13, 2013 @ 08:31:45

        That would have been the funniest part of the challenge. Ever wanted to play a bit with canvas.

        But again not enough time on the weekend. Maybe I will finish a solution and post about it. You will know.

  2. Dylan
    May 10, 2013 @ 19:38:41

    I haven’t started coding yet. But my solution will hang on the 16th incorrect guess.

    Reply

  3. Emiliano
    May 10, 2013 @ 22:29:40

    So it’s a program to cheat at Hangman with friends. Is it ok if I write a program to cheat at poker instead? 🙂

    Reply

  4. ultimateohm
    May 12, 2013 @ 09:25:10

    Be careful that word list. It may contain words with accent but remove them easily by
    grep [a-z] < wordlistfile.txt

    Reply

  5. Trackback: Impossible Hangman | Shiggy Enterprises

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: