presentation/2017_08_01_r_user_hamburg/rmeetup_hamburg_2017_08_01.md

R Class and Package for Generating Crosswords

Peter Meissner 01 July 2017

Usage

library(crossword)
cw <- Crossword$new(rows = 4, columns = 4)
cw$add_words(c("back", "nasa", "kick", "nuk", "ic", "sic"))
## #BACK# / 5 / 1 / right / 
## 
## #NASA# / 1 / 3 / down / 
## 
## #KICK# / 1 / 5 / down / 
## 
## #NUK# / 2 / 2 / right / 
## 
## #IC# / 3 / 4 / down / 
## 
## #SIC# / 4 / 2 / right /

Usage

cw
## . 1 2 3 4 5 6
## 1 # # # # # #
## 2 # # N U K #
## 3 # . A # I #
## 4 # # S I C #
## 5 # B A C K #
## 6 # # # # # #

Data

cw$letters
##      [,1] [,2] [,3] [,4] [,5] [,6]
## [1,] "#"  "#"  "#"  "#"  "#"  "#" 
## [2,] "#"  "#"  "N"  "U"  "K"  "#" 
## [3,] "#"  "."  "A"  "#"  "I"  "#" 
## [4,] "#"  "#"  "S"  "I"  "C"  "#" 
## [5,] "#"  "B"  "A"  "C"  "K"  "#" 
## [6,] "#"  "#"  "#"  "#"  "#"  "#"

Data

cw$words
## # A tibble: 6 x 6
##     row   col length direction  clue  word
##   <int> <int>  <int>     <chr> <chr> <chr>
## 1     5     1      4     right        BACK
## 2     1     3      4      down        NASA
## 3     1     5      4      down        KICK
## 4     2     2      3     right         NUK
## 5     3     4      2      down          IC
## 6     4     2      3     right         SIC

Technicalities

Technicalities

Technicalities

Algorithm?

End



petermeissner/crossword documentation built on May 19, 2019, 8:23 a.m.