警告:这个程序计算用户点击猪精灵的次数,但它有语法错误!

规则:要在事件中使用和更改之前在程序中创建的变量,我们需要使用关键字global后跟我们想在事件中使用的变量名。

  • 点击运行并单击猪。阅读错误信息。
  • 在事件中使用Global Variable ,以便在每次单击猪时将1添加到clicks中。

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)