Ejemplo n.º 1
0
func NewTictactoe(prompter io.Prompter) (t *Tictactoe) {
	board := game.NewTictactoeBoard()
	rules := game.NewTictactoeRules(board)
	players := player.NewTictactoePlayers()

	t = &Tictactoe{board: board, rules: rules, players: players, prompter: prompter}
	return
}
Ejemplo n.º 2
0
func NewAiPlayer(mark game.Mark, board game.Board, prompter io.Prompter) (player Player) {
	rules := game.NewTictactoeRules(board)
	player = &Ai{mark: mark, board: board, prompter: prompter, rules: rules}
	return
}