# 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)
Run the code above in your browser using DataLab