util

package
v0.0.0-...-f8ecacf Latest Latest
Warning

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

Go to latest
Published: May 6, 2016 License: MIT Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Banner()

func ClearScreen

func ClearScreen()

func Confirm

func Confirm(response string) bool

func Continue

func Continue()

func Dying

func Dying() string

func GetChar

func GetChar() (ascii string, keyCode int, err error)

GetChar returns a single string character, without waiting for newline

func GetReturn

func GetReturn() (ascii string)

GetReturn returns a single string character after user enters newline

func Meter

func Meter(num, max, fmax int, l, t string, c string)

Meter provides a health meter to represent health scaled to barWidth.

func PromptConfirm

func PromptConfirm(question string) string

PromptConfirm returns a user entered string with confirmation from the user. e.g. answer := PromptConfirm("What's your name? ") fmt.Println("Your name is:", answer)

func Roll

func Roll(n int, d int) int

Roll is used to simulate die roll. roll n dice of d size, add the results and divide by n Roll(1, 100) will give even distribution between 1 - 100 Roll(2, 100) will push up the bell curve in the middle of the distribution. Roll(3, 100) even more so

func StartBanner

func StartBanner()

Types

type Screenbuffer

type Screenbuffer struct {
	Buffer []string
}

func (*Screenbuffer) Add

func (b *Screenbuffer) Add(s string)

func (*Screenbuffer) Flush

func (b *Screenbuffer) Flush()

func (Screenbuffer) Render

func (b Screenbuffer) Render()

Jump to

Keyboard shortcuts

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