validate

package
v0.0.0-...-e3e679c Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2017 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LotteryEntry

type LotteryEntry struct {
	Red  [6]int
	Blue int
}

LotteryEntry 要验证的一组彩票.

func Combinations

func Combinations(redPrefix []int, redPosfix []int, blue []int) []LotteryEntry

Combinations 生成组合LotteryEntry.

type ValidateEntry

type ValidateEntry struct {
	Entry LotteryEntry
	Match ValidateEntryMatch
	Money int
}

ValidateEntry 单组中奖结果Entry为选择的号码,Match为命中球的详细信息.

type ValidateEntryMatch

type ValidateEntryMatch struct {
	RedCount  int
	BlueCount int
	Red       []int
	Blue      int
}

ValidateEntryMatch 当前号码命中的结果,RedCount红球命中个数,BlueCount蓝球命中个数.

type ValidateResult

type ValidateResult struct {
	Money   int
	Entrys  []ValidateEntry
	History LotteryEntry
	// contains filtered or unexported fields
}

ValidateResult 验证结果Money是总中奖钱数, History是对应期开奖结果.

type Validator

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

Validator 结果验证器.

func NewValidator

func NewValidator(dbFile string) (Validator, error)

func (Validator) Combinations

func (v Validator) Combinations(expect string, redPrefix []int, redPosfix []int, blue []int) (*ValidateResult, error)

Combinations 验证复式结果.

func (Validator) Validate

func (v Validator) Validate(expect string, lotteries []LotteryEntry) (*ValidateResult, error)

Validate 复式结果验证.

Jump to

Keyboard shortcuts

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