internal

package
v0.0.0-...-2841176 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2022 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FirstDayNum = 1
	FirstDay    = "1"

	LastDayNum = 25
	LastDay    = "25"

	TypeLeaderboard = "leaderboard"
	TypeOptimized   = "optimized"

	PartOne = "1"
	PartTwo = "2"

	FirstYearNum = 2015
	FirstYear    = "2015"
)

Variables

View Source
var (
	SolutionTypes = []string{TypeLeaderboard, TypeOptimized}
	SolutionParts = []string{PartOne, PartTwo}
)

Functions

This section is empty.

Types

type Day

type Day struct {
	Year *Year

	Name   string
	Number int
	Input  *Input
	Types  []*Type
	// contains filtered or unexported fields
}

func (Day) Exists

func (p Day) Exists() bool

func (Day) String

func (d Day) String() string

type Input

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

func (Input) Exists

func (p Input) Exists() bool

func (Input) String

func (i Input) String() string

type Main

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

func (Main) Exists

func (p Main) Exists() bool

type MultiWriteCloser

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

MultiWriteCloser is based on io.MultiWriter, but is an io.WriteCloser and can add new io.WriteClosers on the fly

func (*MultiWriteCloser) Add

func (mwc *MultiWriteCloser) Add(w io.WriteCloser)

func (*MultiWriteCloser) Close

func (mwc *MultiWriteCloser) Close() error

func (*MultiWriteCloser) Write

func (mwc *MultiWriteCloser) Write(p []byte) (n int, err error)

type Part

type Part struct {
	Type *Type

	Main *Main
	Name string
	// contains filtered or unexported fields
}

func (Part) Exists

func (p Part) Exists() bool

func (Part) String

func (p Part) String() string

type Skipper

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

func NewSkipper

func NewSkipper(path string) *Skipper

func (*Skipper) Skip

func (s *Skipper) Skip(typ *Type) bool

type Table

type Table struct {
	// NumRows is the number of rows the table has. Each column must have exactly this number of rows.
	NumRows int
	// contains filtered or unexported fields
}

Table is a table that can be rendered to markdown. It supports a column based data API and pads columns to a constant width.

func (*Table) AddColumn

func (t *Table) AddColumn(header string, rows []string)

AddColumn adds a column to the table to the right of existing columns. len(rows) must be equal to NumRows or AddColumn panics.

func (*Table) ToBuffer

func (t *Table) ToBuffer(b *bytes.Buffer)

ToBuffer writes the table to a buffer with a trailing newline.

type Type

type Type struct {
	Day *Day

	Name  string
	Parts []*Part
	// contains filtered or unexported fields
}

func FirstUnsolvedSolution

func FirstUnsolvedSolution(root string, years []*Year, skipper *Skipper) *Type

func NewType

func NewType(root, yearN, dayN, typN string) *Type

func (Type) Exists

func (p Type) Exists() bool

func (Type) String

func (t Type) String() string

type Year

type Year struct {
	Name   string
	Number int
	Days   []*Day
	// contains filtered or unexported fields
}

func GetLocalSolutionInfo

func GetLocalSolutionInfo(root string) []*Year

func (Year) Exists

func (p Year) Exists() bool

func (Year) String

func (y Year) String() string

Jump to

Keyboard shortcuts

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