latest, found a bug, wrote a failing test
This commit is contained in:
34
examples/searchbig/main.go
Normal file
34
examples/searchbig/main.go
Normal file
@@ -0,0 +1,34 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"git.eeqj.de/sneak/pokercore"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
for i := 0; i < 10; i++ {
|
||||
d := pokercore.NewDeck()
|
||||
fmt.Printf("deck before shuffling: %s\n", d.FormatForTerminal())
|
||||
d.ShuffleRandomly()
|
||||
fmt.Printf("deck after shuffling: %s\n", d.FormatForTerminal())
|
||||
offTheTop := d.Deal(11)
|
||||
fmt.Printf("off the top: %s\n", offTheTop.FormatForTerminal())
|
||||
wh, err := offTheTop.IdentifyBestFiveCardPokerHand()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
fmt.Printf("best hand: %s\n", wh.FormatForTerminalSorted(pokercore.AceHighAscending))
|
||||
score, err := wh.PokerHandScore()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
fmt.Printf("best hand score: %s\n", score)
|
||||
ph, err := wh.PokerHand()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
fmt.Printf("best hand string: %s\n", ph.Description())
|
||||
}
|
||||
}
|
||||
BIN
examples/searchbig/searchbig
Executable file
BIN
examples/searchbig/searchbig
Executable file
Binary file not shown.
Reference in New Issue
Block a user