scrabble_dictionary | R Documentation |
Download words from 4 different languages: English, Spanish,
German, and French. Words will be save into the temp
directory.
This is an auxiliary function. You may want to use scrabble_words
directly if you are searching for the highest score words!
Get score for any word or list of words. You may set manually depending on the rules and languages you are playing with. Check the examples for Spanish and English values when I played Words With Friends.
Dataframe for every letter and points given a language.
Find highest score words given a set of letters, rules, and language to win at Scrabble! You just have to find the best place to post your tiles.
scrabble_dictionary(lang_dic, quiet = FALSE)
scrabble_score(words, scores.df)
scrabble_points(lang)
scrabble_words(
tiles = "",
free = 0,
force_start = "",
force_end = "",
force_str = "",
force_exclude = "",
exclude_here = "",
force_n = 0,
force_max = 0,
pattern = "",
repeated = FALSE,
language = Sys.getenv("LARES_LANG"),
scores = language,
words = NULL,
quiet = FALSE,
print = TRUE
)
lang_dic |
Character. Any of "en","es","de","fr". Set to NULL
if you wish to skip this step (and use |
quiet |
Boolean. Do not print words as they are being searched. |
words |
Character vector. Use if you wish to manually add words. |
scores.df |
Dataframe. Must contain two columns: "tiles" with every letter of the alphabet and "scores" for each letter's score. |
lang |
Character. Any of "en","es" or "chars". Set to NULL
if you wish to skip this step (and use |
tiles |
Character. The letters you wish to consider. |
free |
Integer. How many free blank tiles you have? |
force_start , force_end |
Character. Force words to start or end with
a pattern of letters and position. Examples: "S" or "SO" or "__S_O"...
If the string contains tiles that were not specified in |
force_str |
Character vector. Force words to contain strings.
If the string contains tiles that were not specified in |
force_exclude , exclude_here |
Character vector. Exclude words containing these tiles (and positions). Not very relevant on Scrabble but for Wordle. |
force_n , force_max |
Integer. Force words to be n or max n characters long. Leave 0 to ignore parameter. |
pattern |
Character string. Custom regex patterns you'd like to match. |
repeated |
Boolean. By default, no replacement allowed. When activated, a single tile can be repeated and won't be "used and discarded". |
scores , language |
Character. Any of "en","es","de","fr".
If scores is not any of those languages, must be a data.frame that
contains two columns: "tiles" with every letter of the alphabet and
"scores" for each letter's score. If you wish
to overwrite or complement this dictionaries other words you can set to
|
print |
Boolean. Print how many words are left by step. |
data.frame with words and language columns.
data.frame with word, scores, and length values for each word
.
data.frame with tiles and scores for each alphabet letter.
data.frame with matching words found, sorted by higher points.
# For Spanish words
dictionary <- scrabble_dictionary("es")
# 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)
scrabble_points("es")
scrabble_points("en")
# Not yet available
scrabble_points("fr")
# 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",
exclude_here = "__z|j"
)
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.