domain

package
v0.0.0-...-36570af Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HangmanStages = []string{
	`          _______
          |/
          |
          |
          |
          |
          |
          |
          |
        __|________
        |         |
	`,
	`          _______
          |/
          |     ( )
          |
          |
          |
          |
          |
          |
        __|________
        |         |
	`,
	`          _______
          |/
          |     ( )
          |      |
          |
          |
          |
          |
          |
        __|________
        |         |
	`,
	`          _______
          |/
          |     ( )
          |      |_
          |        \\
          |
          |
          |
          |
        __|________
        |         |
	`,
	`          _______
          |/
          |     ( )
          |     _|_
          |    /   \\
          |
          |
          |
          |
        __|________
        |         |
	`,
	`         _______
          |/
          |     ( )
          |     _|_
          |   // | \\
          |      |
          |
          |
          |
        __|________
        |         |
	`,
	`          _______
          |/
          |     (_)
          |    __|__
          |   // | \\
          |      |
          |    // \\
          |   //   \\
          |
        __|________
        |          |
	`,
	`          _______
          |/     |
          |     (_)
          |    __|__
          |   // | \\
          |      |
          |    // \\
          |   //   \\
          |
        __|________
        |__________|

      * * *  RIP  * * *
	`,
}

Functions

This section is empty.

Types

type Game

type Game struct {
	Attempts     int
	MaxAttempts  int
	Letters      map[rune]struct{}
	WrongLetters map[rune]struct{}
	UniqueErrors int
	Word         Word
	HangStages   []string
}

func NewGame

func NewGame(word Word, maxAttempts int) *Game

func (*Game) CheckLetter

func (g *Game) CheckLetter(r rune) bool

func (*Game) IsGameOver

func (g *Game) IsGameOver() bool

func (*Game) IsUserLost

func (g *Game) IsUserLost() bool

func (*Game) IsUserWon

func (g *Game) IsUserWon() bool

func (*Game) SetWord

func (g *Game) SetWord()

func (*Game) WrongLettersToString

func (g *Game) WrongLettersToString() []string

type Word

type Word struct {
	Word       string
	Hint       string
	Dictionary []wordWithHint
}

func NewWord

func NewWord() Word

func (*Word) Build

func (w *Word) Build(cfg *config.Config) error

func (*Word) SetRandomWord

func (w *Word) SetRandomWord() error

Jump to

Keyboard shortcuts

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