league

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DrawPoints = 1
	WinPoints  = 3
	LosePoints = 0
)

Variables

This section is empty.

Functions

func AssignPoints

func AssignPoints(scoreA int, scoreB int) (pointsA int, pointsB int)

Assign points to A and B given their relative scores.

Types

type GameResult

type GameResult struct {
	TeamA  string
	ScoreA int
	TeamB  string
	ScoreB int
}

type Ranking

type Ranking struct {
	Rank   uint
	Team   string
	Points int
}

func CalculateRankings

func CalculateRankings(gameResults []GameResult) []Ranking

Determine the ultimate ranking of all the teams in a league given game results.

Jump to

Keyboard shortcuts

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