第12步:告诉玩家,如果他们出了 "paper" 而计算机出了 "scissors",计算机将会胜出。

  • 添加 if and ,测试choice 是否等于 "paper"computer_choice 是否等于 "scissors"
  • 拖出 Set Text 将指令分配给 result
  • 因为剪刀打败了布,将字符串更改为 "Computer 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)