competition

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: MIT Imports: 8 Imported by: 1

README

Competition

Library to manage and run tournaments and other competitive events

See my competition example for a fully fleshed-out example of how to use it

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BasicTeamScoreLess

func BasicTeamScoreLess(teams []TeamScore) func(i, j int) bool

func BigGameToHTML

func BigGameToHTML(g models.Game, scored bool) ([]byte, error)

func FlipTies

func FlipTies(place int) int

func GameToHTML

func GameToHTML(g models.Game, scored bool) ([]byte, error)

func GenerateTournamentHTML

func GenerateTournamentHTML(t models.Tournament) ([]byte, error)

func IsWinner

func IsWinner(t models.Team, g models.Game, advance uint32) bool

func RandomizeTeams

func RandomizeTeams(teams []models.Team)

Types

type Bracket

type Bracket struct {
	Name        string
	Rounds      [][]models.Game //[]models.Round
	Scored      bool
	Advance     uint32
	FinalWinner bool
}

func (Bracket) FancyHTML

func (b Bracket) FancyHTML() ([]byte, error)

type CompetitionOverError

type CompetitionOverError error

type Pivot

type Pivot struct {
	Place int
	Span  int
}

type Table

type Table struct {
	Name     string
	Gamesize int
	Rows     [][]models.Team
	RowWidth []int
}

func (*Table) ToHTML

func (t *Table) ToHTML() ([]byte, error)

type TeamScore

type TeamScore struct {
	Team  models.Team
	Score int
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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