STEP 17:如果积木列表为空,则用户获胜!让我们将该条件添加到我们的间隔事件中。

  • 在间隔事件中添加if (为间隔事件缩进一次)!
  • choice更改为bricks_left ,将"yes"更改为0 。这将检查列表中是否还有积木!
  • 在图形中在 if 语句中添加Say (缩进两次!)。
  • .say()分配给paddle并将字符串参数编辑为"You win!"

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)