app

package
v0.0.0-...-3f42514 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2025 License: Unlicense Imports: 5 Imported by: 0

Documentation

Index

Constants

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

wordsPerChar is used for computing WPM. Word is considered to be in average 5 characters long.

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

LinesTyped computes the 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