guess

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 31, 2022 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ActiveIndex int = 0

active guess index

View Source
var IsOver bool = false

flag to indicate if word is guessed

View Source
var IsSuccess bool = false

flag to decide if the user has correctly guessed

View Source
var LetterSizeX = 8

grid dimensions wordle letter dimension

View Source
var LetterSizeY = 4
View Source
var TotalTries int = 6

total tries

View Source
var Tries = [6]string{}

tried guesses

View Source
var ValidList []string = append(validGuessList, wordleList...)

valid final list

View Source
var WordLength int = 5

guess word length

View Source
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

func ClearLetter() (row int, col int, err error)

clear word on backspace return row, col to clear the letter error if letter is not be cleared

func HandleLetter

func HandleLetter(letter rune) (row int, col int, err error)

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

func ResetWordle

func ResetWordle()

helper function to reset wordle

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 letter color takes in index and letter we will compare the letter at specified index of the wordle returns LetterPosition

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL