第4步:如果测试为真,任何我们放置在 if 语句内部的代码将会运行。

这个 if 语句检查用户是否出了石头,如果是的,还将设置相应的图像和文本。

  • 点击 ,并将 Say 拖动到 if 区块中,在石头精灵的下方缩进。
  • .say() 前面的名称更改为 player
  • .say() 中的字符串更改为 "I choose rock"

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)