第7步:让我们使用生成的随机图像。

  • 点击 ,将 if 拖动到间隔事件内部。
  • 将测试变量更改为 rand_img,并将测试值更改为 "shark"
  • 点击 ,将 Change Image 拖动到 if 语句内部。确保它带有 ········
  • .load_image() 指令前面的名称更改为 fish。将图像更改为 "shark"

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)