https://github.com/jwodder/hangman
Play Hangman in your terminal
https://github.com/jwodder/hangman
hangman rust terminal tui
Last synced: 3 months ago
JSON representation
Play Hangman in your terminal
- Host: GitHub
- URL: https://github.com/jwodder/hangman
- Owner: jwodder
- License: mit
- Created: 2023-11-12T22:50:18.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-02-09T22:06:18.000Z (5 months ago)
- Last Synced: 2025-03-21T00:21:29.855Z (3 months ago)
- Topics: hangman, rust, terminal, tui
- Language: Rust
- Homepage:
- Size: 152 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://www.repostatus.org/#concept)
[](https://github.com/jwodder/hangman/actions/workflows/test.yml)
[](https://codecov.io/gh/jwodder/hangman)
[](https://www.rust-lang.org)
[](https://opensource.org/licenses/MIT)This is a Rust program for playing a game of [Hangman][] in your terminal.
[Hangman]: https://en.wikipedia.org/wiki/Hangman_(game)

Usage
=====hangman [-f |-w ]
Play Hangman. By default, the secret word is chosen at random from a built-in
list, but it can also be chosen from a file you provide or set to a specific
value passed on the command line.Play consists of entering one letter at a time in order to guess the secret
word. If six incorrect guesses are made before the word is completely
uncovered, you lose (though you will get to see the full word as a
consolation).You can quit the game early at any time by pressing Escape, though you won't
find out what the secret word was that way.Currently, only ASCII letters can be guessed; if the secret word contains any
other kinds of characters, they will be revealed from the start of play rather
than having to be guessed.Options
-------- `-f `, `--words-file ` — Select a word at random from the given
file (or from standard input if `` is `-`). Each word in the file must
be on a line of its own. A word may optionally be given a hint by appending
a comma and then the hint, e.g.:```csv
elephant,Animal
carrot,Vegetable
chalk,Mineral
```- `-w `, `--word ` — Use `` as the secret word. This is
useful for testing or for setting up a game for an opponent to play.