create_game: Set up a holoalphabetic game

Description Usage Arguments Details Value See Also Examples

View source: R/game.R

Description

create_game defines the terms of the game, choosing letters that contain a pangram (i.e., all of them are used together in at least one English word). The function is called automatically by play_game, which then interactively plays the game. However, you can intentionally use create_game to save a set of words.

Usage

1
2
3
4
5
6
7
8
create_game(
  game_letters = NULL,
  central = NULL,
  num_letters = 7,
  min_word_length = 4,
  dictionary = "normal",
  obscenities = FALSE
)

Arguments

game_letters

User-selected letters to use in the game (optional). Will result in a warning if more letters are chosen than num_letters. If including, this should be a character string, e.g., "stb".

central

The central (that is, required) letter (optional). If not provided, will be randomly chosen from among the game_letters.

num_letters

The number of letters for the game; defaults to 7, and should be between 6 and 10.

min_word_length

Expected length of words. Defaults to 4 letters, but can be between 2 and 6.

dictionary

Character string. Choice of how detailed of a dictionary to use. Can be any of "slim", "broad", or "normal". Defaults to "normal", which is recommended.

obscenities

Logical. Should obscenities be included? Defaults to FALSE.

Details

Because of random sampling, it is possible that the internal function will not find a set of letters with a pangram; if so, simply run the function again.

Value

Regardless of whether you include any inputs, the function returns a game object game which can be used with play_game. The results of create_game should be assigned and used in play_game; running it on its own will have no effect.

See Also

play_game to play the game

Examples

1
2
3
create_game()
create_game(num_letters = 6, game_letters = "s")
create_game(obscenities = TRUE)

jdbest/holoalphabetic documentation built on Feb. 10, 2022, 10:11 p.m.