第12步:我们将设置生成的随机数,为计算机选择石头、布或剪刀。

如果生成的随机数为 1,则该测试语句将告诉计算机选择 "rock"

  • 点击 ,将 if 区块拖动到程序底部。
  • 将 if 语句中的测试变量更改为 random_choice。并将测试值更改为 1
  • Rock 精灵拖动到刚刚创建的 if 语句内部。

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)