WordleHelper: R6 Class for tracking Wordle game state

Description Public fields Methods

Description

R6 Class for tracking Wordle game state

R6 Class for tracking Wordle game state

Public fields

words

current list of candidated words which match all information so far

exact

string representing which letters are known exactly, with a period used to indicate that the letter at this position is unknown

wrong_spot

character vector of strings. Each string contains all letters which are known to be part of the word, but do not exist at this particular position

min_count

named vector of known minimum counts

known_count

named vector of known counts for letters e.g. if 'e' is known only to appear once, then 'known_count = c(e = 1)'

nchar

number of characters in word Initialize Wordle

Methods

Public methods


Method new()

Usage
WordleHelper$new(nchar, words = wordle_dict)
Arguments
nchar

number of characters in the word

words

character vector of candidated words Update the internal list of candidate words


Method update()

Usage
WordleHelper$update(word, response)
Arguments
word

the attempted word that was entered into the system

response

a vector of colours representing the response from the system to this word. Allowed colours: "green", "yellow", "grey" or "gray"


Method clone()

The objects of this class are cloneable with this method.

Usage
WordleHelper$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


ylmazkanat/world.github.io documentation built on Jan. 24, 2022, 12:07 a.m.