第10步:告诉玩家,如果他们出"paper" 而计算机出"rock"时,玩家将胜出。

使用其他 if 语句作为指导来帮助你完成这些。 更改 if 语句中的名称和值。

  • 添加 if and 语句来测试 choice 是否等于 "paper"computer_choice 是否等于 "rock"
  • 拖出 Set Text ,将指令分配给 result 文本。
  • 因为布打败了石头,将字符串更改为 "Player wins!"

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • 提交作品
  • 下个活动
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)