pokesay

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Rand rand.Source = rand.NewSource(time.Now().UnixNano())
)

Functions

func Check

func Check(e error)

func ChooseByCategory added in v0.11.0

func ChooseByCategory(categoryKey string, categories pokedex.Trie) (*pokedex.Entry, []string)

func ChooseByName added in v0.11.0

func ChooseByName(name string, categories pokedex.Trie) *pokedex.PokemonMatch

func ChooseByRandomIndex added in v0.11.0

func ChooseByRandomIndex(totalInBytes []byte) (int, int)

func ListCategories

func ListCategories(categories pokedex.Trie) []string

func Print added in v0.11.0

func Print(args Args, choice int, names []string, categories []string, cows embed.FS)

The main print function! This uses a chosen pokemon's index, names and categories, and an embedded filesystem of cowfile data 1. The text received from STDIN is printed inside a speech bubble 2. The cowfile data is retrieved using the matching index, decompressed (un-gzipped), 3. The pokemon is printed along with the name & category information

func RandomInt

func RandomInt(n int) int

Types

type Args added in v0.11.0

type Args struct {
	Width          int
	NoWrap         bool
	TabSpaces      string
	NoTabSpaces    bool
	NoCategoryInfo bool
	ListCategories bool
	ListNames      bool
	Category       string
	NameToken      string
	JapaneseName   bool
}

Jump to

Keyboard shortcuts

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