Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type HandDist ¶
type HandDist struct {
Dist string
}
A hand distribution is a category of hands. Currently the only categories supported are those of the forms AA, AKo, and AKs.
type Lottery ¶
type Lottery struct {
// contains filtered or unexported fields
}
func NewLottery ¶
Convert a discrete distribution (array-map {item prob}) into a lottery. The probabilities should add up to 1
Example ¶
lotto := NewLottery(map[string]float64{"a": 0.4, "b": 0.1, "c": 0.5, "d": 0}) fmt.Println(lotto) for i := 0; i < 100; i++ { lotto.Play() }
Output: [ a:0.40 c:0.90 b:1.00 ]
Click to show internal directories.
Click to hide internal directories.