hangman

package
v0.0.0-...-8b59174 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Draw

func Draw(g *Game, guess string)

func DrawWelcome

func DrawWelcome()

func ReadGuess

func ReadGuess() (guess string, err error)

Types

type Game

type Game struct {
	State        string   // Game state
	Letters      []string // Letters in the word to find
	FoundLetters []string // Good guess
	UsedLetters  []string // Used letters
	TurnsLeft    int      // Remaining attempts
}

func New

func New(turns int, word string) (*Game, error)

func (*Game) LoseTurn

func (g *Game) LoseTurn(guess string)

func (*Game) MakeAGuess

func (g *Game) MakeAGuess(guess string)

func (*Game) RevealLetter

func (g *Game) RevealLetter(guess string)

Jump to

Keyboard shortcuts

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