latest, found a bug, wrote a failing test

This commit is contained in:
2024-05-18 17:33:15 -07:00
parent 90a959448a
commit eb85e1d36e
22 changed files with 661 additions and 460 deletions

View 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

Binary file not shown.