tickets

package
v0.0.0-...-062e030 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrIDWithNoMatch = errors.New("ID did not match any tickets")

ErrIDWithNoMatch is thrown when the tickitid does not match any tickets

Functions

func ExportOdds

func ExportOdds() []string

ExportOdds returns a human readable version of the ticket odds

Types

type CheckedTicketAmount

type CheckedTicketAmount struct {
	AmountWonTotal int
	AmountDeducted int
	Wins           []OddsWin
}

CheckedTicketAmount represents a ticket after it has been checked Note that tickets can have multiple odds with different winning prizes

func CheckAmount

func CheckAmount(id string, amount int) (CheckedTicketAmount, error)

CheckAmount checks a ticket a certain amount

type CheckedTicketUntilWin

type CheckedTicketUntilWin struct {
	Prize               int
	Price               int
	AmountBought        int
	OutOfOdds           int
	AmountDeductedTotal int
	Profit              int
}

CheckedTicketUntilWin is what is returned to the user after they choose to buy until win

func CheckUntilWin

func CheckUntilWin(id string) (CheckedTicketUntilWin, error)

CheckUntilWin buys tickets until a success

type OddsWin

type OddsWin struct {
	OutOfOdds     int // If the odds are 1/10. Then this number would be 10.
	Prize         int
	AmountThatWon int
	TotalWinning  int
}

OddsWin represents the winnings of a certain set of odds. For example 1/10

type Ticket

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

Ticket represents a lottery ticket

Jump to

Keyboard shortcuts

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