wordle_check {lares} | R Documentation |
Wordle Game Validation
Description
Given and input and a word, validate each letter based on Wordle's rules: correct letter in correct placement (green), correct letter in wrong placement (yellow), letter is not present (red).
Usage
wordle_check(
input,
word,
dictionary = NULL,
lang_dic = "en",
method = 3,
print = TRUE
)
## S3 method for class 'wordle_check'
print(x, print = TRUE, ...)
wordle_dictionary(lang_dic = "en", method = 3, quiet = TRUE)
wordle_simulation(input, word, seed = NULL, quiet = FALSE, ...)
## S3 method for class 'wordle_simulation'
print(x, type = 1, ...)
Arguments
input |
Character. Word to validate (5-letters) |
word |
Character. Word actually answer (5-letters). |
dictionary |
Character vector. List of valid words. If set to NULL
then will use modified |
lang_dic |
Character. Any of: "en", "es". Only used when |
method |
Integer. 1 for |
print |
Boolean. Print validation results? |
x |
Object to print |
... |
Additional parameters. |
quiet |
Boolean. Do not print words as they are being searched. |
seed |
Numeric. For reproducibility. Accepts more than one: will run as many seeds there are. |
type |
Integer. 1 for summary and 2 for coloured results. |
Value
Invisible vector with results by letter.
Examples
word <- "ABBEY"
# Or pick a random one:
# word <- sample(wordle_dictionary("en"), 1)
wordle_check("OPENS", word)
wordle_check("BABES", word)
wordle_check("KEBAB", word, print = FALSE)
wordle_check("ABYSS", word)
wordle_check("ABBEY", word)
# Feel free to use scrabble_words() for hints
x <- wordle_simulation(input = "SAINT", word = "ABBEY", seed = 1:3)
print(x)
# hist(sapply(x, function(x) x$iters))