麻将胡牌算法(包括查听,查胡)
package main import ( "fmt" ) func main() { list := []int{11, 12, 13, 14, 14, 15, 16, 12} // lists := combination(list, []int{}) // for k, l := range lists { // fmt.Printf("组合:%v===", k) // for _, c := range l.combin { // fmt.Printf("类型:%v 值:%v;", c.tp, c.values) // } // fmt.Println() // } m := outTS(list) for k, v := range m { fmt.Printf("打出:%v,可以胡%v\n", k, v) } } func outTS(list []int) map[int][]int { var ts = make(map[int][]int, 0) out := make([]int, 0) if len(list)%3 !
Read More →