第3步:五名宇航员被困了!我们将使用循环来给出一组将设置五个宇航员的指令。

我们还将使用随机整数指令,让循环每次运行时创建一个新的随机 x 坐标!

  • 点击 ,将 Loop with Range 拖动到程序中。
  • 点击 ,将 Random Integer 拖动到循环内部,让它的前面有一个紫色区块 ···
  • 将整数命名为 rand_x 。更改 rand_x 的范围以选择 -230230 之间的数字。

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)