crowns/util.go

22 lines
382 B
Go
Raw Permalink Normal View History

2024-01-07 01:51:06 +00:00
package main
func search(hand []Card, wildFace int, search Card) []int {
ret := []int{}
for idx, c := range hand {
if c.Masked() {
continue // Doesn't match anything
}
if c == search || c.Joker() || c.Face() == wildFace {
2024-01-07 01:51:06 +00:00
ret = append(ret, idx)
}
}
return ret
}
func forkHand(hand []Card) []Card {
ret := make([]Card, len(hand))
copy(ret, hand)
return ret
}