Documentation ¶
Overview ¶
TODO:
- !! free chars - special chars are pre-filled
- bitmask chars
https://en.wikipedia.org/wiki/List_of_birds_by_common_name https://en.wikipedia.org/w/api.php?action=parse&page=List_of_birds_by_common_name&format=json&prop=links
Index ¶
- Constants
- func CheckWord(s string) error
- func FetchWikiLinks(ctx context.Context, page string) ([]string, error)
- func NormalizeWord(s string) string
- func PrepareWord(word string, filter WordFilter) string
- func PrepareWords(s []string, filter WordFilter) []string
- func ReadWordsFile(path string, filter WordFilter) (s []string, err error)
- type Dictionary
- type Game
- func (g *Game) CheckGuess(word string) error
- func (g *Game) GetGuess(i int) MarkedWord
- func (g *Game) Guess(word string) error
- func (g *Game) GuessesAllowed() int
- func (g *Game) GuessesLeft() int
- func (g *Game) GuessesMade() int
- func (g *Game) HasGuessedChar(c rune) bool
- func (g *Game) State() State
- func (g *Game) Word() string
- type Mark
- type MarkedWord
- type Renderer
- type State
- type TermRenderer
- type WordFilter
Constants ¶
View Source
const DefaultWikiBirdsPage = "List_of_birds_by_common_name"
View Source
const DefaultWordsFilePath = "/usr/share/dict/words"
Variables ¶
This section is empty.
Functions ¶
func NormalizeWord ¶
func PrepareWord ¶
func PrepareWord(word string, filter WordFilter) string
func PrepareWords ¶
func PrepareWords(s []string, filter WordFilter) []string
func ReadWordsFile ¶
func ReadWordsFile(path string, filter WordFilter) (s []string, err error)
Types ¶
type Dictionary ¶
type Dictionary struct {
// contains filtered or unexported fields
}
func NewDictionary ¶
func NewDictionary(s []string) *Dictionary
func (*Dictionary) Contains ¶
func (d *Dictionary) Contains(w string) bool
func (*Dictionary) Get ¶
func (d *Dictionary) Get(i int) string
func (*Dictionary) Len ¶
func (d *Dictionary) Len() int
func (*Dictionary) Random ¶
func (d *Dictionary) Random() string
type Game ¶
type Game struct {
// contains filtered or unexported fields
}
func (*Game) CheckGuess ¶
func (*Game) GetGuess ¶
func (g *Game) GetGuess(i int) MarkedWord
func (*Game) GuessesAllowed ¶
func (*Game) GuessesLeft ¶
func (*Game) GuessesMade ¶
func (*Game) HasGuessedChar ¶
type MarkedWord ¶
type TermRenderer ¶
type TermRenderer struct{}
func (TermRenderer) RenderGame ¶
func (r TermRenderer) RenderGame(g *Game) string
func (TermRenderer) RenderWord ¶
func (r TermRenderer) RenderWord(mw MarkedWord) string
type WordFilter ¶
func WordLenFilter ¶
func WordLenFilter(i int) WordFilter
Click to show internal directories.
Click to hide internal directories.