Beispiel #1
0
func Create() *Arena {
	a := &Arena{
		battle_id,
		0,
		make([]*player.Player, 0),
		board.Create(),
	}
	battle_id += 1
	return a
}
Beispiel #2
0
func main() {

	address := flag.String("listen", "127.0.0.1:6666", "server listen address")
	players_per_game := flag.Int("players", 2, "number of players in one arena")

	flag.Parse()
	if len(flag.Args()) != 0 {
		switch flag.Args()[0] {
		case "board":
			b := board.Create()
			fmt.Print(b)
		default:
			fmt.Println("Unknown command")
		}
	} else {
		gameLoop(*address, *players_per_game)
	}

}