wordsearch {worrrd}R Documentation

Create a wordsearch puzzle

Description

Create a wordsearch puzzle

Usage

wordsearch(
  words = c("finding", "needles", "inside", "haystacks"),
  clues = words,
  r = 10,
  c = 10,
  image = NULL
)

Arguments

words

a vector of hidden words (character/vector)

clues

a vector of word clues (optional; character/vector)

r

number of rows

c

number of columns

image

path to an image that the resulting grid should look like.NULL for no shape

Value

wordsearch object

Examples

# Example 1 ----
words <- c("dog", "cat", "horse", "frog", "cow", "fox")
ex1 <- wordsearch(words, r = 10, c = 10)
plot(ex1, solution = TRUE)

# Example 2 ----
clues <- c("Bark", "Meow", "Neigh", "Ribbit", "Moo", "Nee Nee Nee")
ex2 <- wordsearch(words = words, clues = clues)
plot(ex2, solution = TRUE, title = "Animal Sounds", legend_size = 4)

# Example 3 ----
math <- dplyr::tribble(
  ~problem,  ~solution,
  "2 + 2",   "four",
  "5 + 3",   "eight",
  "9 - 4",   "five",
  "1 + 0",   "one",
  "2 + 1",   "three",
  "5 + 5",   "ten",
  "6 - 6",   "zero"
 )
 ex3 <- wordsearch(words = math$solution, clues = math$problem)
 plot(ex3, solution = TRUE, title = "Math is Fun")


[Package worrrd version 0.1.0 Index]