コード例 #1
0
async def start(ctx):

    global game
    game = chess.Board()

    await ctx.send('The game has started.')
    await ctx.send('Board positions are shown in algebraic notation')
    await ctx.send('Prefix algebraic notation with command `move`')
    await ctx.send('Waiting for first move ...')

    await ctx.send(game.fen())
コード例 #2
0
 def __init__(self, n):
     "Set up initial board configuration."
     self.n = n
     # Create the empty board array.
     # self.pieces = [None]*self.n
     # for i in range(self.n):
     #     self.pieces[i] = [0]*self.n
     #
     # # Set up the initial 4 pieces.
     # self.pieces[int(self.n/2)-1][int(self.n/2)] = 1
     # self.pieces[int(self.n/2)][int(self.n/2)-1] = 1
     # self.pieces[int(self.n/2)-1][int(self.n/2)-1] = -1;
     # self.pieces[int(self.n/2)][int(self.n/2)] = -1;
     board = chess.Board()
     X = numpy.array([self.bb2array(board)])
     self.pieces = self.vector2matrix(X[0])
     self.chessboard = board