scores

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

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

Go to latest
Published: Aug 4, 2017 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Type

type Type struct {
	// contains filtered or unexported fields
}

Type defines the data structure of the scores object

func NewScores

func NewScores(filename string, numScores int) Type

NewScores creates a new scores struct

func (*Type) AddScore

func (t *Type) AddScore(score int, name string)

AddScore pushes a new high score into the scores table

func (*Type) GetBottomScore

func (t *Type) GetBottomScore() int

GetBottomScore returns the points value of the nth high score in descending order

func (*Type) GetTopScores

func (t *Type) GetTopScores() [][]string

GetTopScores returns the top n scores as a string slice, ordered in desecnding order of points

func (*Type) LoadScores

func (t *Type) LoadScores()

LoadScores loads saved scores from a csv file

func (*Type) SaveScores

func (t *Type) SaveScores()

SaveScores saves the scores to a csv file

Jump to

Keyboard shortcuts

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