Crossword {crossword.r}R Documentation

Crossword

Description

Crossword

Usage

Crossword

Format

An R6Class generator object for generating crosswords from word lists

Fields

letters

a character matrix representing the grid of the crossword

words

a data.frame like (tibble) storing words, their position on the grid (row, col), their length in character, their direction ("right", "down") the word and the clue

Methods

add_words(words, clues = NULL)

this method will try to add words to the crossword by placing it on the grid; clues is optional and should be the same length;

density()

gives back statistics on fill state of grid

to_json(pretty = FALSE)

thi exports grid and word list data to JSON for external usage; pretty parameter determines if this is done in a human readable or more machine efficient way

Examples


library(crossword.r)
cw <- Crossword$new(rows = 4, columns = 4)
cw$add_words(c("back", "nasa", "kick", "nuk", "ic", "sic"))
cw
cw$letters
cw$words
cw$density()


[Package crossword.r version 0.3.6 Index]