Documentation ¶
Index ¶
- Constants
- Variables
- type Position
- type Verifier
- func Ascending() *Verifier
- func AscendingOrDecendingSequenceOfSize(size int) *Verifier
- func AscendingSequenceOfSize(size int) *Verifier
- func Descending() *Verifier
- func DescendingSequenceOfSize(size int) *Verifier
- func EqualsNumber(position Position, equalTo int) *Verifier
- func Even(position Position) *Verifier
- func GreaterThanNumber(position Position, greaterThan int) *Verifier
- func LessThanNumber(position Position, lessThan int) *Verifier
- func MoreEvens() *Verifier
- func MoreOdds() *Verifier
- func NoOrder() *Verifier
- func NoPairs() *Verifier
- func NumberAppearsTimes(numberToCount, appearsTimes int) *Verifier
- func NumberOfEvens(nEvensToCheckFor int) *Verifier
- func Odd(position Position) *Verifier
- func PositionEqualsPosition(position Position, isEqualToPosition Position) *Verifier
- func PositionGreaterThanPosition(position Position, isGreaterThanPosition Position) *Verifier
- func PositionIsLargest(position Position) *Verifier
- func PositionIsLargestOrEqual(position Position) *Verifier
- func PositionIsSmallest(position Position) *Verifier
- func PositionIsSmallestOrEqual(position Position) *Verifier
- func PositionLessThanPosition(position Position, isLessThanPosition Position) *Verifier
- func RepeatsTimes(repeatsTimes int) *Verifier
- func SumOfTwoPositionsEqualsNumber(position1, position2 Position, equals int) *Verifier
- func SumOfTwoPositionsGreaterThanNumber(position1, position2 Position, greaterThan int) *Verifier
- func SumOfTwoPositionsLessThanNumber(position1, position2 Position, lessThan int) *Verifier
- func SummationEqualsNumber(equals int) *Verifier
- func SummationGreaterThanNumber(greaterThan int) *Verifier
- func SummationIsEven() *Verifier
- func SummationIsMultipleOf(multipleOf int) *Verifier
- func SummationIsOdd() *Verifier
- func SummationLessThanNumber(lessThan int) *Verifier
- type VerifierCard
Constants ¶
View Source
const ( Blue = Position(0) Yellow = Position(1) Purple = Position(2) )
Variables ¶
View Source
var Cards = []VerifierCard{ { CardNumber: 1, Verifiers: []*Verifier{ EqualsNumber(0, 1), GreaterThanNumber(0, 1), }, }, { CardNumber: 2, Verifiers: []*Verifier{ LessThanNumber(0, 3), EqualsNumber(0, 3), GreaterThanNumber(0, 3), }, }, { CardNumber: 3, Verifiers: []*Verifier{ LessThanNumber(1, 3), EqualsNumber(1, 3), GreaterThanNumber(1, 3), }, }, { CardNumber: 4, Verifiers: []*Verifier{ LessThanNumber(1, 4), EqualsNumber(1, 4), GreaterThanNumber(1, 4), }, }, { CardNumber: 5, Verifiers: []*Verifier{ Even(0), Odd(0), }, }, { CardNumber: 6, Verifiers: []*Verifier{ Even(1), Odd(1), }, }, { CardNumber: 7, Verifiers: []*Verifier{ Even(2), Odd(2), }, }, { CardNumber: 8, Verifiers: []*Verifier{ NumberAppearsTimes(1, 0), NumberAppearsTimes(1, 1), NumberAppearsTimes(1, 2), NumberAppearsTimes(1, 3), }, }, { CardNumber: 9, Verifiers: []*Verifier{ NumberAppearsTimes(3, 0), NumberAppearsTimes(3, 1), NumberAppearsTimes(3, 2), NumberAppearsTimes(3, 3), }, }, { CardNumber: 10, Verifiers: []*Verifier{ NumberAppearsTimes(4, 0), NumberAppearsTimes(4, 1), NumberAppearsTimes(4, 2), NumberAppearsTimes(4, 3), }, }, { CardNumber: 11, Verifiers: []*Verifier{ PositionLessThanPosition(0, 1), PositionEqualsPosition(0, 1), PositionGreaterThanPosition(0, 1), }, }, { CardNumber: 12, Verifiers: []*Verifier{ PositionLessThanPosition(0, 2), PositionEqualsPosition(0, 2), PositionGreaterThanPosition(0, 2), }, }, { CardNumber: 13, Verifiers: []*Verifier{ PositionLessThanPosition(1, 2), PositionEqualsPosition(1, 2), PositionGreaterThanPosition(1, 2), }, }, { CardNumber: 14, Verifiers: []*Verifier{ PositionIsSmallest(0), PositionIsSmallest(1), PositionIsSmallest(2), }, }, { CardNumber: 15, Verifiers: []*Verifier{ PositionIsLargest(0), PositionIsLargest(1), PositionIsLargest(2), }, }, { CardNumber: 16, Verifiers: []*Verifier{ MoreEvens(), MoreOdds(), }, }, { CardNumber: 17, Verifiers: []*Verifier{ NumberOfEvens(0), NumberOfEvens(1), NumberOfEvens(2), NumberOfEvens(3), }, }, { CardNumber: 18, Verifiers: []*Verifier{ SummationIsEven(), SummationIsOdd(), }, }, { CardNumber: 19, Verifiers: []*Verifier{ SumOfTwoPositionsLessThanNumber(0, 1, 6), SumOfTwoPositionsEqualsNumber(0, 1, 6), SumOfTwoPositionsGreaterThanNumber(0, 1, 6), }, }, { CardNumber: 20, Verifiers: []*Verifier{ RepeatsTimes(3), RepeatsTimes(2), RepeatsTimes(1), }, }, { CardNumber: 21, Verifiers: []*Verifier{ NoPairs(), RepeatsTimes(2), }, }, { CardNumber: 22, Verifiers: []*Verifier{ Ascending(), Descending(), NoOrder(), }, }, { CardNumber: 23, Verifiers: []*Verifier{ SummationLessThanNumber(6), SummationEqualsNumber(6), SummationGreaterThanNumber(6), }, }, { CardNumber: 24, Verifiers: []*Verifier{ AscendingSequenceOfSize(3), AscendingSequenceOfSize(2), AscendingSequenceOfSize(1), }, }, { CardNumber: 25, Verifiers: []*Verifier{ AscendingOrDecendingSequenceOfSize(1), AscendingOrDecendingSequenceOfSize(2), AscendingOrDecendingSequenceOfSize(3), }, }, { CardNumber: 26, Verifiers: []*Verifier{ LessThanNumber(0, 3), LessThanNumber(1, 3), LessThanNumber(2, 3), }, }, { CardNumber: 27, Verifiers: []*Verifier{ LessThanNumber(0, 4), LessThanNumber(1, 4), LessThanNumber(2, 4), }, }, { CardNumber: 28, Verifiers: []*Verifier{ EqualsNumber(0, 1), EqualsNumber(1, 1), EqualsNumber(2, 1), }, }, { CardNumber: 29, Verifiers: []*Verifier{ EqualsNumber(0, 3), EqualsNumber(1, 3), EqualsNumber(2, 3), }, }, { CardNumber: 30, Verifiers: []*Verifier{ EqualsNumber(0, 4), EqualsNumber(1, 4), EqualsNumber(2, 4), }, }, { CardNumber: 31, Verifiers: []*Verifier{ GreaterThanNumber(0, 1), GreaterThanNumber(1, 1), GreaterThanNumber(2, 1), }, }, { CardNumber: 32, Verifiers: []*Verifier{ GreaterThanNumber(0, 3), GreaterThanNumber(1, 3), GreaterThanNumber(2, 3), }, }, { CardNumber: 33, Verifiers: []*Verifier{ Even(0), Odd(0), Even(1), Odd(1), Even(2), Odd(2), }, }, { CardNumber: 34, Verifiers: []*Verifier{ PositionIsSmallestOrEqual(0), PositionIsSmallestOrEqual(1), PositionIsSmallestOrEqual(2), }, }, { CardNumber: 35, Verifiers: []*Verifier{ PositionIsLargestOrEqual(0), PositionIsLargestOrEqual(1), PositionIsLargestOrEqual(2), }, }, { CardNumber: 36, Verifiers: []*Verifier{ SummationIsMultipleOf(3), SummationIsMultipleOf(4), SummationIsMultipleOf(5), }, }, { CardNumber: 37, Verifiers: []*Verifier{ SumOfTwoPositionsEqualsNumber(0, 1, 4), SumOfTwoPositionsEqualsNumber(0, 2, 4), SumOfTwoPositionsEqualsNumber(1, 2, 4), }, }, { CardNumber: 38, Verifiers: []*Verifier{ SumOfTwoPositionsEqualsNumber(0, 1, 6), SumOfTwoPositionsEqualsNumber(0, 2, 6), SumOfTwoPositionsEqualsNumber(1, 2, 6), }, }, { CardNumber: 39, Verifiers: []*Verifier{ EqualsNumber(0, 1), EqualsNumber(1, 1), EqualsNumber(2, 1), GreaterThanNumber(0, 1), GreaterThanNumber(1, 1), GreaterThanNumber(2, 1), }, }, { CardNumber: 40, Verifiers: []*Verifier{ LessThanNumber(0, 3), LessThanNumber(1, 3), LessThanNumber(2, 3), EqualsNumber(0, 3), EqualsNumber(1, 3), EqualsNumber(2, 3), GreaterThanNumber(0, 3), GreaterThanNumber(1, 3), GreaterThanNumber(2, 3), }, }, { CardNumber: 41, Verifiers: []*Verifier{ LessThanNumber(0, 4), LessThanNumber(1, 4), LessThanNumber(2, 4), EqualsNumber(0, 4), EqualsNumber(1, 4), EqualsNumber(2, 4), GreaterThanNumber(0, 4), GreaterThanNumber(1, 4), GreaterThanNumber(2, 4), }, }, { CardNumber: 42, Verifiers: []*Verifier{ PositionIsSmallest(0), PositionIsSmallest(1), PositionIsSmallest(2), PositionIsLargest(0), PositionIsLargest(1), PositionIsLargest(2), }, }, { CardNumber: 43, Verifiers: []*Verifier{ PositionLessThanPosition(0, 1), PositionLessThanPosition(0, 2), PositionEqualsPosition(0, 1), PositionEqualsPosition(0, 2), PositionGreaterThanPosition(0, 1), PositionGreaterThanPosition(0, 2), }, }, { CardNumber: 44, Verifiers: []*Verifier{ PositionLessThanPosition(1, 0), PositionLessThanPosition(1, 2), PositionEqualsPosition(1, 0), PositionEqualsPosition(1, 2), PositionGreaterThanPosition(1, 0), PositionGreaterThanPosition(1, 2), }, }, { CardNumber: 45, Verifiers: []*Verifier{ NumberAppearsTimes(1, 0), NumberAppearsTimes(1, 1), NumberAppearsTimes(1, 2), NumberAppearsTimes(3, 0), NumberAppearsTimes(3, 1), NumberAppearsTimes(3, 2), }, }, { CardNumber: 46, Verifiers: []*Verifier{ NumberAppearsTimes(3, 0), NumberAppearsTimes(3, 1), NumberAppearsTimes(3, 2), NumberAppearsTimes(4, 0), NumberAppearsTimes(4, 1), NumberAppearsTimes(4, 2), }, }, { CardNumber: 47, Verifiers: []*Verifier{ NumberAppearsTimes(1, 0), NumberAppearsTimes(1, 1), NumberAppearsTimes(1, 2), NumberAppearsTimes(4, 0), NumberAppearsTimes(4, 1), NumberAppearsTimes(4, 2), }, }, { CardNumber: 48, Verifiers: []*Verifier{ PositionLessThanPosition(0, 1), PositionLessThanPosition(0, 2), PositionLessThanPosition(1, 2), PositionEqualsPosition(0, 1), PositionEqualsPosition(0, 2), PositionEqualsPosition(1, 2), PositionGreaterThanPosition(0, 1), PositionGreaterThanPosition(0, 2), PositionGreaterThanPosition(1, 2), }, }, }
Functions ¶
This section is empty.
Types ¶
type Verifier ¶
func AscendingOrDecendingSequenceOfSize ¶
AscendingOrDecendingSequenceOfSize use size of 1 for no sequence
func AscendingSequenceOfSize ¶
AscendingSequenceOfSize use size of 1 for no sequence
func Descending ¶
func Descending() *Verifier
func DescendingSequenceOfSize ¶
DescendingSequenceOfSize use size of 1 for no sequence
func EqualsNumber ¶
func GreaterThanNumber ¶
func LessThanNumber ¶
func NumberAppearsTimes ¶
func NumberOfEvens ¶
func PositionEqualsPosition ¶
func PositionIsLargest ¶
func PositionIsSmallest ¶
func RepeatsTimes ¶
func SummationEqualsNumber ¶
func SummationIsEven ¶
func SummationIsEven() *Verifier
func SummationIsMultipleOf ¶
func SummationIsOdd ¶
func SummationIsOdd() *Verifier
func SummationLessThanNumber ¶
type VerifierCard ¶
func (VerifierCard) Combine ¶
func (vc VerifierCard) Combine(other VerifierCard) VerifierCard
func (VerifierCard) String ¶
func (vc VerifierCard) String() string
Click to show internal directories.
Click to hide internal directories.