コード例 #1
0
ファイル: gametick.go プロジェクト: esanmiguelc/gottt
func takeTurn(board board.Board, playerOne, playerTwo iplayer.Player, movesPlayed []int) []int {
	currentPlayer := gamestate.GetCurrentPlayer(board, playerOne, playerTwo)
	if currentPlayer.IsComputer() {
		move := currentPlayer.GetMove(board, currentPlayer.GetMark(), gamestate.GetOpponentMark(currentPlayer.GetMark()))
		board.PlaceMove(move, currentPlayer.GetMark())
		movesPlayed = append(movesPlayed, move)
	}
	return movesPlayed
}
コード例 #2
0
ファイル: gametick.go プロジェクト: esanmiguelc/gottt
func rebuildBoard(board board.Board, movesPlayed []int) {
	for _, move := range movesPlayed {
		board.PlaceMove(move, gamestate.GetCurrentMark(board))
	}
}