gordle

package
v0.0.0-...-d50ba91 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartFyneGame

func StartFyneGame()

Types

type AppState

type AppState struct {
	// contains filtered or unexported fields
}

func NewAppState

func NewAppState() *AppState

type Color

type Color string
const (
	Grey   Color = "grey"
	Yellow Color = "yellow"
	Green  Color = "green"
)

type Feedback

type Feedback struct {
	Colors []Color
}

func FromGuess

func FromGuess(guess Word, solution Word) Feedback

func NewFeedback

func NewFeedback(colors []Color) (Feedback, error)

func (*Feedback) IsWin

func (feedback *Feedback) IsWin() bool

type Game

type Game struct {
	State    State
	Tries    int
	Solution Word
}

func NewGame

func NewGame() Game

func (*Game) Guess

func (game *Game) Guess(guess Word) (Game, Feedback, error)

type State

type State string
const (
	Started State = "started"
	Won     State = "won"
	Lost    State = "lost"
)

type Word

type Word struct {
	Letters string
}

func NewWord

func NewWord(letters string) (Word, error)

func RandomWord

func RandomWord() Word

Jump to

Keyboard shortcuts

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