Learn R Programming

player (version 0.1.0)

play_jumble: Play a game of jumbles in the console

Description

Play a game of jumbles in the console

Usage

play_jumble(
  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.

Difficulty

Difficulty levels are defined as follows:

  • beginner: very common English words with 3 to 5 letters

  • easy: common English words with 4 to 6 letters

  • medium: slightly less common English words with 5 to 8 letters

  • hard: somewhat less common English words with 6 to 11 letters

  • expert: less common English words with 7 to 15 letters

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_jumble()

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

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

Run the code above in your browser using DataLab