func printResults(tbl *table.Table, results map[int][]*table.Result) { players := tbl.Players() for seat, resultList := range results { for _, result := range resultList { fmt.Println(players[seat].Player().ID()+":", result) } } }
func printTable(tbl *table.Table) { players := tbl.Players() fmt.Println("") fmt.Println("-----Table-----") fmt.Println(tbl) fmt.Println(players[0]) fmt.Println(players[1]) fmt.Println("-----Table-----") fmt.Println("") }
func runTable(tbl *table.Table) { for { results, done, err := tbl.Next() if done { return } printTable(tbl) if err != nil { fmt.Println("Error", err) } if results != nil { printResults(tbl, results) } } }