this doesn't work yet, just saving
This commit is contained in:
parent
d973c1e1ea
commit
daa52b9f3c
|
@ -190,43 +190,3 @@ func proto() {
|
||||||
fmt.Printf("community: %s\n", cmty)
|
fmt.Printf("community: %s\n", cmty)
|
||||||
}
|
}
|
||||||
|
|
||||||
func scorePokerHand(input Cards) (score int) {
|
|
||||||
/*
|
|
||||||
|
|
||||||
scoring system:
|
|
||||||
high card:
|
|
||||||
high card * 14^4
|
|
||||||
+ first kicker * 14^3
|
|
||||||
+ second kicker * 14^2
|
|
||||||
+ third kicker * 14
|
|
||||||
+ fourth kicker
|
|
||||||
max(AKQJ9): 576,011
|
|
||||||
single pair:
|
|
||||||
pair value * 1,000,000
|
|
||||||
+ first kicker * 14^2
|
|
||||||
+ second kicker * 14
|
|
||||||
+ third kicker
|
|
||||||
max(AAKQJ): 14,002,727
|
|
||||||
two pair:
|
|
||||||
higher of the two pair value * 100,000,000
|
|
||||||
+ lower of the two pair value * 14
|
|
||||||
+ kicker value
|
|
||||||
max(AAKKQ): 1,300,000,179
|
|
||||||
trips:
|
|
||||||
trips value * 1,000,000,000 (min 2,000,000,000)
|
|
||||||
+ first kicker * 14
|
|
||||||
+ second kicker
|
|
||||||
max (AAAKQ): 14,000,000,194
|
|
||||||
straight:
|
|
||||||
highest card * 10,000,000,000
|
|
||||||
straight to the ace: 140,000,000,000
|
|
||||||
flush:
|
|
||||||
highest card * 100,000,000,000
|
|
||||||
min(23457): 700,000,000,000
|
|
||||||
max(AXXXX): 1,400,000,000,000
|
|
||||||
boat:
|
|
||||||
|
|
||||||
|
|
||||||
*/
|
|
||||||
return 1
|
|
||||||
}
|
|
||||||
|
|
|
@ -0,0 +1,65 @@
|
||||||
|
package pokercore
|
||||||
|
|
||||||
|
type HEPokerHand struct {
|
||||||
|
Cards Cards
|
||||||
|
HandScore HandScore
|
||||||
|
}
|
||||||
|
|
||||||
|
type HandScoreType uint8
|
||||||
|
type HandScoreRanking Rank
|
||||||
|
|
||||||
|
type HandScore struct {
|
||||||
|
Type HandScoreType
|
||||||
|
Ranking HandScoreRanking
|
||||||
|
Kickers Cards
|
||||||
|
Description string
|
||||||
|
}
|
||||||
|
|
||||||
|
const (
|
||||||
|
HIGH_CARD HandScoreType = 0
|
||||||
|
ONE_PAIR HandScoreType = 1
|
||||||
|
TWO_PAIR HandScoreType = 2
|
||||||
|
SET HandScoreType = 3
|
||||||
|
STRAIGHT HandScoreType = 4
|
||||||
|
FLUSH HandScoreType = 5
|
||||||
|
BOAT HandScoreType = 6
|
||||||
|
QUADS HandScoreType = 7
|
||||||
|
STRAIGHT_FLUSH HandScoreType = 8
|
||||||
|
)
|
||||||
|
|
||||||
|
func (self *HandScore) BeatsHand(v *HandScore) bool {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func (self *HEPokerHand) IsReducedYet() bool {
|
||||||
|
if len(self.Cards) == 5 {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
func (self *HEPokerHand) IsPair() bool {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (self *HEPokerHand) IsTwoPair() bool {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (self *HEPokerHand) IsSet() bool {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (self *HEPokerHand) IsStraight() bool {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (self *HEPokerHand) IsFlush() bool {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (self *HEPokerHand) IsBoat() bool {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (self *HEPokerHand) ScoreHand() *HandScore {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func scoreHEPokerHand(input Cards) (hand HEPokerHand) {
|
||||||
|
return 1
|
||||||
|
}
|
Loading…
Reference in New Issue