crossword | R Documentation |
Create a crossword puzzle
crossword(words, clues, r = 50, c = 50, method = c("optimal", "random"))
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 |
crossword object
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.