lib

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2022 License: Apache-2.0, GPL-3.0 Imports: 11 Imported by: 0

README

Go-Wordle

This is a CLI version of popular game Wordle powered by golang.

The word dictionary is extracted from the javascript file of the official wordle.

How to play
  • Download the binary file from the release page

  • Or build the binary file through go install

go install github.com/XiaoMengXinX/go-wordle@latest
  • Or compile it from the source code:
git clone https://github.com/XiaoMengXinX/go-wordle
cd go-wordle
go build wordle.go

Run:

./go-wordle
Custom dictionaries

You can use the -w option to specify the custom word dictionary file like this:

./go-wordle -w your_wordlist.txt

The word list file must be in this format:

word1
word2
word3
...
wordN

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Wordle

type Wordle struct {
	sync.RWMutex

	Word    string                 `json:"word"`
	Tries   int32                  `json:"tries"`
	Guesses map[string][]*pb.Guess `json:"guesses"`
}

func NewWordle

func NewWordle() *Wordle

func (*Wordle) Guess

func (w *Wordle) Guess(player, word string) (string, []*pb.Guess, error)

func (*Wordle) Load

func (w *Wordle) Load(b []byte) error

func (*Wordle) Next

func (w *Wordle) Next()

func (*Wordle) Save

func (w *Wordle) Save() ([]byte, error)

Jump to

Keyboard shortcuts

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