Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ActiveIndex int = 0
active guess index
var IsOver bool = false
flag to indicate if word is guessed
var IsSuccess bool = false
flag to decide if the user has correctly guessed
var TotalTries int = 6
total tries
var Tries = [6]string{}
tried guesses
var ValidList []string = append(validGuessList, wordleList...)
valid final list
var WordLength int = 5
guess word length
var Wordle string = getWordle()
wordle for the game
Functions ¶
func Calculate ¶
func Calculate() (err error)
calculate word on hitting enter 1. Enter is hit before word is complete 2. Enter is hit after word is complete
func ClearLetter ¶
clear word on backspace return row, col to clear the letter error if letter is not be cleared
func HandleLetter ¶
handle incoming letter if the current word is not complete, append the letter and notify the ui that ui has to be updated if the current word is full, just ignore the incoming letters
Types ¶
type LetterPosition ¶
type LetterPosition string
letter position related stuffs
const ( // letter is in correct position LetterPositionCorrect LetterPosition = "correct" // letter is NOT in correct position LetterPositionInCorrect LetterPosition = "incorrect" // letter is not in word LetterPositionMissing LetterPosition = "missing" // neutral state; we have not yet calculated letter position LetterPositionBlank LetterPosition = "blank" )
func FindLetterPosition ¶
func FindLetterPosition(index int, letter string) (pos LetterPosition)
helper function to calculate color letter takes in index and letter we will compare the letter at specified index of the wordle returns LetterPosition