Display binary numbers (without calculations)

Challenge Level: Beginner

Learning outcomes

Students will be able to:

Requirement:

Create a program to display numbers 1, 2, 4, 8 and 16 on the screen, one at a time.

Testing examples:

The output will always show the numbers 1, 2, 4, 8 and 16 (there is no input).

Languages

Scratch

What it should look like

Click on the green flag to see the expected output of your program.

Recommended blocks
whenclickedsay1for1secssay2for1secssay4for1secssay8for1secssay16for1secs
Hints
  • Click inside the sayHellofor2secs block and type to change “Hello” to what you want to display on the screen. In this case, it will be ‘1’ for the first output, ‘2’ for the second, ‘4’ for the third and so on.

  • The number of seconds tells the output how long to show. The script waits that long before continuing.

  • Make sure all your blocks are “snapped” together in a line like a jigsaw puzzle.

  • Whenever you click the green flag, your script will start. To stop, click the stop button.

Show Scratch solution

Python
Block-based

Extra Challenge

Display the numbers from largest to smallest (display numbers 16, 8, 4, 2 and 1).