crossword {worrrd} | R Documentation |
Create a crossword puzzle
Description
Create a crossword puzzle
Usage
crossword(words, clues, r = 50, c = 50, method = c("optimal", "random"))
Arguments
words |
a vector of words (character/vector) |
clues |
a vector a clues (character/vector) |
r |
number of rows (numeric/scalar) |
c |
number of columns (numeric/scalar) |
method |
generate puzzle using 'optimal' or 'random' word order, where the optimal order will place words with the most overlap first |
Value
crossword object
Examples
# Example 1 ----
words <- c("apple", "pear", "banana")
clues <- c("red fruit", "bartlett", "green then yellow")
x <- crossword(words, clues)
plot(x, solution = TRUE)
# Example 2 ---
dat <-
dplyr::tribble(
~word, ~clue,
"dog", "Bark. Bark. Bark.",
"cat", "Purrr",
"horse", "Neighhhhh",
"frog", "Ribbit Ribbit",
"cow", "Moooooooo",
"fox", "Nee Nee Nee (What does the ____ say?)",
"sheep", "Bleat",
"snake", "Hissss",
"duck", "Quack",
"bird", "Chirp"
)
ex2 <- crossword(words = dat$word, clues = dat$clue, r = 40, c = 40)
plot(ex2, solution = TRUE, clues = TRUE)
[Package worrrd version 0.1.0 Index]