STEP 3: Five astronauts are stranded! We'll use a loop to give one set of commands that will set up all five astronauts.

We'll also use a random integer command so that each time the loop runs, it creates a new random x coordinate!

  • Go to and drag Loop with Range into your program.
  • Go to and drag Random Integer inside the loop, so that it has a purple block ··· in front of it.
  • Name the integer rand_x. Change the range of rand_x to select a number between -230 and 230.

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
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)