ticket

package
v0.0.0-...-07010e4 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2024 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 Range

type Range struct {
	From, To int
}

func ParseRange

func ParseRange(s string) (Range, error)

type Rule

type Rule struct {
	Name   string
	Ranges []Range
}

func ParseRule

func ParseRule(s string) (*Rule, error)

func (*Rule) IsValid

func (r *Rule) IsValid(n int) bool

func (*Rule) IsValidForAll

func (r *Rule) IsValidForAll(ns []int) bool

func (Rule) String

func (r Rule) String() string

type Rules

type Rules []*Rule

func (Rules) IsValidNumber

func (rs Rules) IsValidNumber(n int) bool

func (Rules) IsValidTicket

func (rs Rules) IsValidTicket(t *Ticket) ([]int, bool)

type Ticket

type Ticket struct {
	Numbers []int
}

func ParseTicket

func ParseTicket(s string) (*Ticket, error)

Jump to

Keyboard shortcuts

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