Error with Blackjack_game

未关闭
#676 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
45/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
停滞
技术栈
python
领域
game-dev

调研方向

检查 blackjack.py 第 89 行附近的输入处理,以及 blackjack_rr.py 第 184 行附近的 player_chips 初始化。手动运行两个 blackjack 示例,以确认 hit/stay 输入正常工作,并且玩家的筹码总数会在多局游戏之间保持不变。完成标准是修正报告中的两种行为,同时不改变游戏流程。

由索引模型根据 Issue 内容生成。

描述

blackjack.py:
On line 89, the datatype for the user input is a string which doesn't match up with the datatype for the if statement condition on line 90. Since the else statement is automatically executed, the player stays even if wanting to play their hand. A quick fix would be to change line 89 to:

k = int(input('Want to hit or stay?\n Press 1 for hit and 0 for stay '))

blackjack_rr.py:
The total amount of chips the player has doesn't carry over to the next game. A quick fix would be to move line 184 to right before the while statement:

#GAMEPLAY

player_chips = Chips()

while True:
主要语言
Python
星标
35.4k
派生
12.9k
平均合并
2 小时 37 分钟
30 天内合并 PR
1

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

geekcomputers/Python 的其他 Issue

查看 geekcomputers/Python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。