Example #1
0
File: main.go Project: notnil/joker
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)
		}
	}
}
Example #2
0
File: main.go Project: notnil/joker
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("")
}
Example #3
0
File: main.go Project: notnil/joker
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)
		}
	}
}