def __init__(self, ctx, opponent):
self.ctx = ctx
self.board = Board()
self.opponent = opponent
xo = random.sample((Tile.X, Tile.O), 2)
self.players = random.sample(list(map(Player, (self.ctx.author, self.opponent), xo)), 2)
self._current = None
self._runner = None
player_field = '\n'.join(itertools.starmap('{1} = **{0}**'.format, self.players))
instructions = ('Type the number of the column to play!\n'
'Or `quit` to stop the game (you will lose though).')
self._game_screen = (discord.Embed(colour=0x00FF00)
.set_author(name=f'Connect 4 - {self.ctx.author} vs {self.opponent}')
.add_field(name='Players', value=player_field)
.add_field(name='Current Player', value=None, inline=False)
.add_field(name='Instructions', value=instructions)
)
评论列表
文章目录