board.py 文件源码

python
阅读 36 收藏 0 点赞 0 评论 0

项目:othello-rl 作者: jpypi 项目源码 文件源码
def printBoard(self, t='live'):
        """
        Print board to terminal for debugging
        @param string type 'virtual' or 'live'
        """
        board = self.board if t == 'live' else self.virtualBoard

        print(Back.GREEN +              "\t      BOARD      ")

        # Print column titles
        head = Back.GREEN + Fore.WHITE + "\t "
        for i in range(self.board.shape[0]):
            head += '|' + str(i)
        print(head)

        # Print rows
        for i in range(self.board.shape[0]):
            print(Back.GREEN + Fore.WHITE + "\t" + str(i) + getRow(board[i]))
        print(Style.RESET_ALL)

        return
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号