-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsuit_string.go
57 lines (48 loc) · 1.34 KB
/
suit_string.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// Code generated by "stringer -type=Suit,Rank"; DO NOT EDIT.
package shuffle
import "strconv"
func _() {
// An "invalid array index" compiler error signifies that the constant values have changed.
// Re-run the stringer command to generate them again.
var x [1]struct{}
_ = x[Spade-0]
_ = x[Diamond-1]
_ = x[Club-2]
_ = x[Heart-3]
_ = x[Joker-4]
}
const _Suit_name = "SpadeDiamondClubHeartJoker"
var _Suit_index = [...]uint8{0, 5, 12, 16, 21, 26}
func (i Suit) String() string {
if i >= Suit(len(_Suit_index)-1) {
return "Suit(" + strconv.FormatInt(int64(i), 10) + ")"
}
return _Suit_name[_Suit_index[i]:_Suit_index[i+1]]
}
func _() {
// An "invalid array index" compiler error signifies that the constant values have changed.
// Re-run the stringer command to generate them again.
var x [1]struct{}
_ = x[Ace-1]
_ = x[Two-2]
_ = x[Three-3]
_ = x[Four-4]
_ = x[Five-5]
_ = x[Six-6]
_ = x[Seven-7]
_ = x[Eight-8]
_ = x[Nine-9]
_ = x[Ten-10]
_ = x[Jack-11]
_ = x[Queen-12]
_ = x[King-13]
}
const _Rank_name = "AceTwoThreeFourFiveSixSevenEightNineTenJackQueenKing"
var _Rank_index = [...]uint8{0, 3, 6, 11, 15, 19, 22, 27, 32, 36, 39, 43, 48, 52}
func (i Rank) String() string {
i -= 1
if i >= Rank(len(_Rank_index)-1) {
return "Rank(" + strconv.FormatInt(int64(i+1), 10) + ")"
}
return _Rank_name[_Rank_index[i]:_Rank_index[i+1]]
}