scratchcards

package
v0.0.0-...-81698c8 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cards

type Cards []ScratchCard

func ParseCards

func ParseCards(r io.Reader) (Cards, error)

func (Cards) CalcCopies

func (cs Cards) CalcCopies() int

func (Cards) Points

func (cs Cards) Points() int

type ScratchCard

type ScratchCard struct {
	ID      int   // The ID of the card.
	Winning []int // List of winning numbers, i.e. if your any of your numbers match a winning number, you win points.
	Yours   []int // Your pre-selected numbers. If any of these numbers match a winning number, you win!
	Copies  int   // Number of times the cards has been copied.
}

func (*ScratchCard) Decode

func (s *ScratchCard) Decode(raw string) error

func (ScratchCard) Matches

func (s ScratchCard) Matches() int

Matches returns the number of winning number matches on the card.

func (ScratchCard) Points

func (s ScratchCard) Points() int

Jump to

Keyboard shortcuts

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