Elm-hangman - word game

Elm-hangman features a list of guess words (theme: animals) and a stage done with ASCII graphics. Each failed guess adds one part on the hangman stage. Completed hangman stage results in a loss.

To change the guess word list, update the wordList.

You can test the game on ellie-app

The source code is at GitHub

6 Likes

When you guess a character, if it appears many times, it should fill all the matches.

It does. Take “CATERPILLAR” for example. You click “L” and it fills both. If it is different in your case, please let me know on concrete example and I will recheck the code.

I guess it is because it places first and last letter for new words, which is not how I play, and I wasn’t paying enough attention, so I though that I had already typed the first letter but it wasn’t case.

Looks great!

It’d be nice to have it react to keypress events, rather than having to click the on-screen keyboard?

Also a minor bug I’ve spotted is that if the word doesn’t contain any other instances of the initially revealed start/end letter then clicking on that letter does nothing. It seems to me that it should count as a bad guess?

e.g. L----D, I click D and nothing happens because the only D in lizard is the last letter. This means I’ve learned that D is not in the word without it costing me a guess, which recommends a strategy of “always guess the start and end letter first” for your implementation!

Good observation. I have made some changes:

  • added the keyboard support for guessing the letters
  • pressing the character that has been already guessed results in failed attempt

Check on Ellie-app

@holobeat this is great!

I played a few rounds and had a blast, thanks for sharing!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.