wordle

package
v0.0.0-...-82d4744 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Character

type Character struct {
	C        byte
	Position bool
	Present  bool
}

Character holds a specific character guess in a specific row.

Value 'C' holds the specific character

'Position' holds whether the character is in the correct position
'Present' holds whether the character is present in the word, but wrong pos

func (Character) Emoji

func (c Character) Emoji() string

func (Character) String

func (c Character) String() string

type Game

type Game struct {
	Word     string
	Rows     []Row
	Date     time.Time
	Complete bool
}

Game represents a day's game, including guesses and the day the game was generated for

func NewGame

func NewGame() *Game

func (*Game) Emoji

func (g *Game) Emoji() string

func (*Game) Guess

func (g *Game) Guess(s string) (correct bool)

func (*Game) String

func (g *Game) String() string

type Row

type Row struct {
	Characters []Character
}

Row holds a slice of Character types representing a guess from a user

func (Row) Emoji

func (r Row) Emoji() string

func (Row) String

func (r Row) String() string

type Wordle

type Wordle struct {
	Games []*Game
}

Wordle holds the state for a set of games

func (Wordle) Cleanup

func (Wordle) Cleanup() error

func (Wordle) Description

func (Wordle) Description() string

func (Wordle) Name

func (Wordle) Name() string

func (*Wordle) Run

func (w *Wordle) Run() (err error)

Jump to

Keyboard shortcuts

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