|
|
|
@ -4,6 +4,7 @@ import ( |
|
|
|
"fmt" |
|
|
|
"fmt" |
|
|
|
"math/rand" |
|
|
|
"math/rand" |
|
|
|
"texas-poker-bk/internal/conf" |
|
|
|
"texas-poker-bk/internal/conf" |
|
|
|
|
|
|
|
"texas-poker-bk/internal/game" |
|
|
|
"texas-poker-bk/internal/server" |
|
|
|
"texas-poker-bk/internal/server" |
|
|
|
"time" |
|
|
|
"time" |
|
|
|
) |
|
|
|
) |
|
|
|
@ -20,32 +21,32 @@ func startServer() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func main() { |
|
|
|
func main() { |
|
|
|
startServer() |
|
|
|
//startServer()
|
|
|
|
|
|
|
|
|
|
|
|
//public := [5]*game.Card{
|
|
|
|
public := [5]*game.Card{ |
|
|
|
// {Dot: game.Poker10, Suit: game.Club},
|
|
|
|
{Dot: game.Poker10, Suit: game.Club}, |
|
|
|
// {Dot: game.Poker6, Suit: game.Spade},
|
|
|
|
{Dot: game.Poker6, Suit: game.Spade}, |
|
|
|
// {Dot: game.Poker7, Suit: game.Diamond},
|
|
|
|
{Dot: game.Poker7, Suit: game.Diamond}, |
|
|
|
// {Dot: game.Poker5, Suit: game.Heart},
|
|
|
|
{Dot: game.Poker5, Suit: game.Heart}, |
|
|
|
// {Dot: game.PokerK, Suit: game.Diamond},
|
|
|
|
{Dot: game.PokerK, Suit: game.Diamond}, |
|
|
|
//}
|
|
|
|
} |
|
|
|
//h1 := [2]*game.Card{
|
|
|
|
h1 := [2]*game.Card{ |
|
|
|
// {Dot: game.PokerA, Suit: game.Spade},
|
|
|
|
{Dot: game.PokerA, Suit: game.Spade}, |
|
|
|
// {Dot: game.Poker5, Suit: game.Spade},
|
|
|
|
{Dot: game.Poker5, Suit: game.Spade}, |
|
|
|
//}
|
|
|
|
} |
|
|
|
//h2 := [2]*game.Card{
|
|
|
|
h2 := [2]*game.Card{ |
|
|
|
// {Dot: game.Poker6, Suit: game.Club},
|
|
|
|
{Dot: game.Poker6, Suit: game.Club}, |
|
|
|
// {Dot: game.Poker3, Suit: game.Diamond},
|
|
|
|
{Dot: game.Poker3, Suit: game.Diamond}, |
|
|
|
//}
|
|
|
|
} |
|
|
|
//h3 := [2]*game.Card{
|
|
|
|
h3 := [2]*game.Card{ |
|
|
|
// {Dot: game.Poker9, Suit: game.Club},
|
|
|
|
{Dot: game.Poker9, Suit: game.Club}, |
|
|
|
// {Dot: game.Poker10, Suit: game.Heart},
|
|
|
|
{Dot: game.Poker10, Suit: game.Heart}, |
|
|
|
//}
|
|
|
|
} |
|
|
|
//hand1, err := game.AnalyzeMaxHand(h1, public)
|
|
|
|
hand1, err := game.AnalyzeMaxHand(h1, public) |
|
|
|
//hand2, err := game.AnalyzeMaxHand(h2, public)
|
|
|
|
hand2, err := game.AnalyzeMaxHand(h2, public) |
|
|
|
//hand3, err := game.AnalyzeMaxHand(h3, public)
|
|
|
|
hand3, err := game.AnalyzeMaxHand(h3, public) |
|
|
|
//fmt.Println(err, hand1)
|
|
|
|
fmt.Println(err, hand1) |
|
|
|
//fmt.Println(err, hand2)
|
|
|
|
fmt.Println(err, hand2) |
|
|
|
//fmt.Println(err, hand3)
|
|
|
|
fmt.Println(err, hand3) |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|