Skip to content

Instantly share code, notes, and snippets.

@mvalipour
Last active January 16, 2021 12:25
Show Gist options
  • Save mvalipour/2fe863b1d884880ff77cded0908aeb24 to your computer and use it in GitHub Desktop.
Save mvalipour/2fe863b1d884880ff77cded0908aeb24 to your computer and use it in GitHub Desktop.
const DECK uint64 = 1 << 52 - 1
func isValidSet(x uint64) (bool) {
return x <= DECK
}
const (
heart_a uint64 = 1 << iota // 2^0
heart_2 = 1 << iota // 2^1
heart_3 = 1 << iota // 2^2
heart_4 = 1 << iota // 2^3
heart_5 = 1 << iota // 2^4
heart_6 = 1 << iota // 2^5
heart_7 = 1 << iota // 2^6
heart_8 = 1 << iota // 2^7
heart_9 = 1 << iota // 2^8
heart_10 = 1 << iota // 2^9
heart_j = 1 << iota // 2^10
heart_q = 1 << iota // 2^11
heart_k = 1 << iota // 2^12
spade_a = 1 << iota // 2^13
spade_2 = 1 << iota // 2^14
spade_3 = 1 << iota // 2^15
spade_4 = 1 << iota // 2^16
spade_5 = 1 << iota // 2^17
spade_6 = 1 << iota // 2^18
spade_7 = 1 << iota // 2^19
spade_8 = 1 << iota // 2^20
spade_9 = 1 << iota // 2^21
spade_10 = 1 << iota // 2^22
spade_j = 1 << iota // 2^23
spade_q = 1 << iota // 2^24
spade_k = 1 << iota // 2^25
diamond_a = 1 << iota // 2^26
diamond_2 = 1 << iota // 2^27
diamond_3 = 1 << iota // 2^28
diamond_4 = 1 << iota // 2^29
diamond_5 = 1 << iota // 2^30
diamond_6 = 1 << iota // 2^31
diamond_7 = 1 << iota // 2^32
diamond_8 = 1 << iota // 2^33
diamond_9 = 1 << iota // 2^34
diamond_10 = 1 << iota // 2^35
diamond_j = 1 << iota // 2^36
diamond_q = 1 << iota // 2^37
diamond_k = 1 << iota // 2^38
club_a = 1 << iota // 2^39
club_2 = 1 << iota // 2^40
club_3 = 1 << iota // 2^41
club_4 = 1 << iota // 2^42
club_5 = 1 << iota // 2^43
club_6 = 1 << iota // 2^44
club_7 = 1 << iota // 2^45
club_8 = 1 << iota // 2^46
club_9 = 1 << iota // 2^47
club_10 = 1 << iota // 2^48
club_j = 1 << iota // 2^49
club_q = 1 << iota // 2^50
club_k = 1 << iota // 2^51
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment