Hangman is a paper and pencil guessing game for two or more players. One player thinks of a word, phrase or sentence and the other tries to guess it by suggesting letters or numbers, within a certain number of guesses. In this version for children the computer selects a word, phrase or sentence randomly out of a word-list defined in a configuration file. In the course of the game ASCII-Art images - designed for children - are progressively disclosed. There are 10 built in ASCII-Art images from which one is chosen randomly at the beginning of the game. Alternatively own ASCII-Art can be provided in the configuration file.

Example 1. Screenshot
HANGMAN GAME
         ,.
        (_|,.
       ,' /, )_______
    __j o``-'        `
   (")
    `-j                |
      `-._(           /
         |_\  |--^.  /
        /_]'|_| /_)_/
           /_]'  /_]'

Lives:  6       Last guess: g

 g o o d   l u _ k

Type a letter then type [Enter]:

The project is hosted on Github: getreu/asciiart-hangman-for-kids.rs. The project’s webpage is on getreu.net. There you also find a pdf rendition of this document and compiled binaries.

Installation

Linux

  1. Download the binary hangman from here.

  2. Copy it in $PATH

    sudo cp hangman /usr/local/bin
  3. Generate a sample configuration file in your working directory

    hangman
  4. Edit the configuration file

    nano hangman-words.txt
  5. Start the game

    hangman

Windows

  1. Download and install the terminal-emulator ConEmu from here.

  2. Download the binary hangman.exe from here.

  3. Copy hangman.exe in a directory of your choice, for example c:\99-tools\

  4. Open the properties of the Shortcut ConEmu (x64) on your desktop.

    01a Shortcut properties
  5. On the General tab, change the program name to Hangman for kids.

    01b Shortcut properties2
  6. Append "C:\99-tools\hangman.exe" to ConEmu64.exe

    02 Target

    Leave Start in empty.

  7. Generate a sample configuration file on your desktop with double click on the Hangman for Kids Shortcut on your desktop.

  8. Edit the configuration file with Wordpad.

  9. Start the game with double click on the Hangman for Kids Shortcut on your desktop.

    03 Terminal

Usage

Usage: hangman [FILE]...
       hangman (-c|--help)
       hangman

[FILE] are configuration files containing word-lists and optionally Ascii-Art images.

When no [FILE] argument is given, [FILE] defaults to 'hangman-words.txt'. In case no [FILE] is found, a template configuration file 'hangman-words.txt' is written into the current working directory. Multiple `[FILE]`s are concatted.

[FILE] is an Ascii file containing 4 different line-types:

  • lines starting with # is ignored.

  • lines starting with | are part of an optional Ascii-Art image shown progressively in the course of the game. If not defined here, built in Ascii-Art images are used instead.

  • lines starting with : are game modifier. They change the logic how the image is progressively disclosed: :success-rewarding Every guessed character shows a bit more of the image. This mode is default. :traditional-rewarding Every lost live discloses a bit more of the image. Choose this mode together with a traditional gallows image (not built in).

  • lines starting with - are guessing strings. At the beginning of the game one line is randomly chosen and all characters are hidden. In order to give additional hints it is possible to enclose some characters with *. These words are then displayed in clear. For example a config line: - Guess *me* is shown in the game as: _ _ _ _ _ _ m e.

Sample configuration file

### This is a sample word-list for the hangman game

### Sample word-list
#   ----------------
#
# Before every game one line is randomly chosen.
# Empty lines and lines starting with # are ignored.
# Lines with guessing strings must start with '-'.
# Words enclosed with * are not hidden when the game starts:
#   - *guess *me
# shows in the game:
#   g u e s s   _ _
#

- *guess* me
- hang*man*
- good luck


# Lines starting with ':' are game modifier. They change
# the logic how the image is progressively disclosed:
#   ':success-rewarding'       Every guessed character shows a bit more of the
#                              image. This mode is default.
#   ':traditional-rewarding'   Every lost live discloses a bit more of the
#                  image. Choose this mode together with a
#                              traditional gallows image (not built in).


### Sample custom image
#   -------------------
#
# Instead of built in images a word list can use a
# custom image. Lines starting with '|' are interpreted
# as image-lines. Delete '#' in the following lines to
# try out this feature.

#:traditional-rewarding
#|  ______
#|  |    |
#|  |    O
#|  |   /|\\
#|  |    |
#|  |   / \\
#|__|_____
#||      |___
#||_________|