game

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GREEN  = "🟩"
	YELLOW = "🟨"
	GRAY   = "⬛"
)

Variables

View Source
var VALID_ANSWERS = [...]string{}/* 2309 elements not displayed */
View Source
var VALID_GUESSES = [...]string{}/* 14843 elements not displayed */

from https://gist.github.com/dracos/dd0668f281e685bad51479e5acaadb93 removed a few (~10) swears and other words

Functions

func PlayCli

func PlayCli(answer string)

answer may be empty, in which case a real answer will be generated

Types

type Game

type Game struct {
	ShowStats        bool
	ShowOngoingStats bool
	ShowGuesses      bool
	ShowIntro        bool
	ShowAnswerOnLoss bool
	ShowWinText      bool
}

func (*Game) PlayGame

func (g *Game) PlayGame(getGuess func(lastGuess string, lastGuessStats string) string) Results

func (*Game) PlayGameWithAnswer

func (g *Game) PlayGameWithAnswer(answer string, getGuess GuessDecider) Results

type GuessDecider

type GuessDecider = func(lastGuess string, lastGuessStats string) string

type Results

type Results struct {
	Won     bool
	Guesses int
}

Jump to

Keyboard shortcuts

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