Macros§
- clear
- A clutter helper to clear the terminal screen
- flush
- A clutter helper to flush the stdout on call
- newln
- A clutter-helper to avoid repeated
println!()
. Specify the number of newlines desired or omit for a single one. - sleep
- A clutter helper to sleep for a specified amount of time (milliseconds)
- warning
- A macro to print a standardised warning.
Structs§
Enums§
- Difficulty
- Three default difficulties for games to make use of.
- Mints
- These are the games available. Game names are parsed through
clap
’sValueParser
.
Constants§
- GAME_
ONGOING - Used to signify to the
mint_cli
to continue the game loop. - GAME_
OVER - Used to signify to the
mint_cli
to break the game loop. - GAME_
RESTART - Used to signify to the
mint_cli
to restart the game loop. - WORDS_
4E - WORDS_
4H - WORDS_
4M - WORDS_
5E - WORDS_
5H - WORDS_
5M - WORDS_
6E - WORDS_
6H - WORDS_
6M - WORDS_
7E - WORDS_
7H - WORDS_
7M - WORDS_
8E - WORDS_
8H - WORDS_
8M - WORDS_
MASTER - This is the
words_alpha.txt
list from the dwyl/english_words Github repository. It contains all alpha words. Used to check if a guessed word actually exists… Considering the size of the list, most guesses probably do…
Traits§
- Game
- Default methods for a terminal-based game.
Functions§
- choose_
random_ word - define
- hint
- load_
word_ list - titled_
loading_ screen - Prints a given header in block form, in the fashion of a pixel-game loading screen.
Specify the desired loading time by passing in
ms
in milliseconds. This function will not clear the terminal after it finishes, leaving it to the game to handle when the loading screen should clear. - word_
exists