app

package
v0.0.0-...-ea35bec Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2021 License: Unlicense Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const InitialLife = 10 * time.Second
View Source
const WPMWindow = 20

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	Text          []rune
	Timeline      []float64
	InputPosition int
	ErrorInput    []rune
	StartedAt     time.Time
	Offset        int

	Zen  bool
	Mute bool

	// Minimal permitted speed
	MinSpeed              int
	LastLifeReductionTime time.Time
	// For how long you could have your speed under speed limit and still continue typing
	RemainingLife time.Duration
	// contains filtered or unexported fields
}

App holds whole app state

func New

func New(text string) (*App, error)

func (*App) CheckWPM

func (a *App) CheckWPM() float64

func (App) LinesTyped

func (a App) LinesTyped() int

Compute number of typed lines

func (*App) Run

func (a *App) Run() error

func (App) Summary

func (a App) Summary() string

func (*App) ToDisplay

func (a *App) ToDisplay() view.DisplayableData

Jump to

Keyboard shortcuts

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