hangman - A text-based hangman
This document describes version 0.063 of hangman (from Perl distribution Games-Hangman), released on 2020-06-02.
% hangman % hangman -l Proverb::TWW; # select specific word-/phraselist % hangman --help % hangman --version
Example of game display:
____ | | Phrase #: 2 | o Guessed : abcmtwxyz | /|\ Average : 50% | | | / _|_ | |______ | | |__________| List : Proverb::TWW Phrase: A--'- w--- t-at ---- w---. Guess :
This is yet another text-based implementation of the popular word game Hangman. In Hangman, you guess a word letter-by-letter. There is a maximum of seven wrong guesses. Each wrong guess will incrementally draw a figure of a man being hung. What's different about this particular variant:
Longer phrases are allowed
Wordlists (or phrase list) are searched from WordList::* modules
WordList::*
--list=s, -l
Select word-/phraselist, will be searched in Wordlist::* or WordList::Phrase::.
Wordlist::*
WordList::Phrase::
--wordlist=s, -w
Alias for --wordlist.
--wordlist
--min-len=i
Minimum word/phrase length. The default is 5 for word, 0 for phrase.
--max-len=i
Maximum word/phrase length. The default is unlimited.
This script has shell tab completion capability with support for several shells.
To activate bash completion for this script, put:
complete -C hangman hangman
in your bash startup (e.g. ~/.bashrc). Your next shell session will then recognize tab completion for the command. Or, you can also directly execute the line above in your shell to activate immediately.
~/.bashrc
It is recommended, however, that you install modules using cpanm-shcompgen which can activate shell completion for scripts immediately.
To activate tcsh completion for this script, put:
complete hangman 'p/*/`hangman`/'
in your tcsh startup (e.g. ~/.tcshrc). Your next shell session will then recognize tab completion for the command. Or, you can also directly execute the line above in your shell to activate immediately.
~/.tcshrc
It is also recommended to install shcompgen (see above).
shcompgen
For fish and zsh, install shcompgen as described above.
Please visit the project's homepage at https://metacpan.org/release/Games-Hangman.
Source repository is at https://github.com/perlancar/perl-Games-Hangman.
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=Games-Hangman
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
hangman from bsdgames Debian package
bsdgames
hangman from ppt (Perl Power Tools) on CPAN
ppt
perlancar <perlancar@cpan.org>
This software is copyright (c) 2020, 2016, 2015, 2014 by perlancar@cpan.org.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Games::Hangman, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Games::Hangman
CPAN shell
perl -MCPAN -e shell install Games::Hangman
For more information on module installation, please visit the detailed CPAN module installation guide.