示例#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
}
示例#2
0
文件: ai.go 项目: spadin/tictactoe
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
}