Skip to contents

Play a game of hangman in the console

Usage

play_hangman(
  difficulty = c("beginner", "easy", "medium", "hard", "expert"),
  word_list = NULL
)

Source

The default word list is derived from 12dicts created by Alan Beale.

This word list is passed through the Offensive/Profane Word List created by Luis Von Ahn to filter out potentially unwanted words.

Arguments

difficulty

Determines the length of words used for the game and, if word_list is NULL, how common the words are

word_list

Optionally, a character vector of words used to play the game. If unspecified, a default word list will be used based on difficulty.

Value

Generates interactive output in the console.

Problematic words?

You can report any words you find objectionable to https://github.com/rossellhayes/hangman/issues.

Please report:

  • offensive words

  • words that deal with uncomfortable topics

  • proper nouns

  • text that is not a common English word

Examples

play_hangman()

play_hangman("beginner")
play_hangman("easy")
play_hangman("medium")
play_hangman("hard")
play_hangman("expert")

cars <- unique(gsub(" .*", "", rownames(mtcars)))
play_hangman(word_list = cars)