Example #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
}
Example #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
}