learn

package
v0.0.0-...-fec55e7 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2018 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Drill

func Drill(tl *timelearn.T) error

Drill quizzes the user on the problems in the given timelearn.T task. How the questions and answers are presented is determined by the 'kind' stored when the timelearn.T database was created. New learners can be added by calling Register.

func Register

func Register(kind string, gen func() (UI, error))

Register adds a new user interface. Any database with the given kind will use this function to make a new UI for it.

Types

type Humanized

type Humanized int64

func (Humanized) Format

func (t Humanized) Format(f fmt.State, c rune)

type UI

type UI interface {
	Single(prob, next *timelearn.Problem) (int, error)
	Close() error
}

The UI is responsible for asking the user a question, and determining if they got it right. The prob argument will always point to the problem to learn. 'next' may point to an upcoming problem.

Jump to

Keyboard shortcuts

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