Learn R Programming

player (version 0.1.0)

play_hangman: Play a game of hangman in the console

Description

Play a game of hangman in the console

Usage

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

Value

Generates interactive output in the console.

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.

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

Run this code
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)

Run the code above in your browser using DataLab