run_game {wordPuzzleR}R Documentation

Run word puzzle game

Description

run_game is the main function to run word puzzle game. The word puzzle game requires you to guess the word with single letters in a limited times of trials. The letters you have guessed in the word reveal themselves. If all letters are revealed before your guesses run out, you win this round, otherwise you fail.

Usage

run_game(mask_char = "_", verbose = TRUE, ...)

Arguments

mask_char

(String) letter to mask the letters not guessed in the word.

verbose

(Logical) whether to print welcome and score messages.

...

For internal use only.

Value

Named list of game stats invisibly, including:

score

Named integer with names as success (success rounds) and total (total rounds).

best_guess

Integer as the minimal number of guesses.

best_hit

Named integer with names as hit (guesses that hit any letters in the word) and guess (total guesses).

Examples

# Run word puzzle game
if (interactive() == TRUE) {
  run_game()
}

[Package wordPuzzleR version 0.1.1 Index]