示例#1
0
文件: game.py 项目: jonoff/tictacten
        self.last_move = p.move(self.board, self.last_move.x, self.last_move.y)
        x, y = self.last_move.x, self.last_move.y
        bx, by = self.last_move.boardx, self.last_move.boardy
        self.mini[x][y] = '.'
        self.mark(self.board[bx][by])

        print 'TURN: %d' % self.turn
        print self.board
        print '\nNext move:\n%s' % self.mini
        print '\n\n'

        #check win
        if self.check_win() != BLANK:
            print self.check_win()
            self.gameover = True
            self.winner = self.check_win()
        self.turn += 1
        self.mini.clear()

    def check_win(self):
        return self.board.check_win()


bb = big_board()
bb.randomize()
#bb.check_win()
#print bb

g = game(AI.random_bot(), AI.center_bot())
g.start_game(delay=0.1)