Skip to content

Conversation

@VectorLu
Copy link
Collaborator

improve is_tie

improve is_tie
Copy link
Collaborator Author

@VectorLu VectorLu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

Copy link
Owner

@linksequel linksequel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

提出一点问题

if is_win(game):
return False
# 使用 all 函数和列表推导式检查每一行的每个单元格是否都不为空
if all(all(cell!= '' for cell in row) for row in game):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all是什么意思

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all 函数和列表推导式来检查游戏中的每一行。对于每一行,我们使用另一个 all 函数和列表推导式检查该行的每个单元格是否都不为空

return tie
tie = True
return tie
if is_win(game):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

非常棒的命名

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thx

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tie是什么意思

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tie是什么意思

平局

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants