util: remove dead code
This commit is contained in:
parent
253ef9ce0a
commit
8edbe6ea98
32
util.go
32
util.go
@ -1,9 +1,5 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"sort"
|
||||
)
|
||||
|
||||
func search(hand []Card, wildFace int, search Card) []int {
|
||||
ret := []int{}
|
||||
for idx, c := range hand {
|
||||
@ -18,36 +14,8 @@ func search(hand []Card, wildFace int, search Card) []int {
|
||||
return ret
|
||||
}
|
||||
|
||||
// take takes a single card out of a hand by its index, returning the remaining cards.
|
||||
func take(hand []Card, index int) (Card, []Card) {
|
||||
cc := hand[index]
|
||||
|
||||
rem := make([]Card, 0, len(hand)-1)
|
||||
rem = append(rem, hand[0:index]...)
|
||||
rem = append(rem, hand[index+1:]...)
|
||||
|
||||
return cc, rem
|
||||
}
|
||||
|
||||
func forkPossibilities(in map[int]struct{}) map[int]struct{} {
|
||||
ret := map[int]struct{}{}
|
||||
for prev, _ := range in {
|
||||
ret[prev] = struct{}{}
|
||||
}
|
||||
return ret
|
||||
}
|
||||
|
||||
func forkHand(hand []Card) []Card {
|
||||
ret := make([]Card, len(hand))
|
||||
copy(ret, hand)
|
||||
return ret
|
||||
}
|
||||
|
||||
func flattenPossibility(in map[int]struct{}) []int {
|
||||
flat := make([]int, 0, len(in))
|
||||
for cidx, _ := range in {
|
||||
flat = append(flat, cidx)
|
||||
}
|
||||
sort.Ints(flat)
|
||||
return flat
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user