# NOT RUN {
# For Spanish words
dictionary <- scrabble_dictionary("es")
# }
# NOT RUN {
# For Spanish words (default)
es_scores <- scrabble_points("es")
# Custom scores for each letter
cu_scores <- data.frame(
tiles = tolower(LETTERS),
scores = c(1, 1, 1, 1, 1, 1, 1, 5, 1, 1, 5, 2, 4, 2, 1, 4, 10, 1, 1, 1, 2, 5, 4, 8, 3, 10)
)
# Score values for each set of rules
words <- c("Bernardo", "Whiskey", "R is great")
scrabble_score(words, es_scores)
scrabble_score(words, cu_scores)
# }
# NOT RUN {
scrabble_points("es")
scrabble_points("en")
# Not yet available
scrabble_points("fr")
# }
# NOT RUN {
# Automatic use of languages and scores
Sys.setenv("LARES_LANG" = "es")
scrabble_words(
tiles = "hola",
free = 2,
force_start = "h",
force_n = 4,
force_str = "_o_a"
)
wordle <- c("board", "tempo", "shoes", "hoard")
scrabble_words(
language = NULL,
words = wordle,
force_n = 5,
force_str = "O_R"
)
# Words considered for a language (you can custom it too!)
es_words <- scrabble_dictionary("es")
# }
Run the code above in your browser using DataLab