Crate mints

Source

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§

Args

Enums§

Difficulty
Three default difficulties for games to make use of.
Mints
These are the games available. Game names are parsed through clap’s ValueParser.

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_clito 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