×

Challenges

  1. Not started

  2. Not started

  3. Not started

  4. Not started

  5. Not started

  6. Not started

  7. Not started

  8. Not started

  9. Not started

  10. Not started

  11. Not started

  12. Not started

  13. Not started

Challenge 3.1

Display number of dots from the given largest card to 1

Challenge Level: Growing experience

Requirement:

Write a program that takes the largest number of dots on a card as an input and displays the bit values from largest to smallest as the output.

Hints
  • Make a variable called “number of dots” and set it to the largest number of dots entered as the input. Divide the value of “number of dots” by 2 and display the result as the output until “number of dots” is equal to 1.
  • Use the 'Divide' block under “Operators” to divide the value of your variable by 2.
  • Use the 'Repeat until' block to run the blocks inside while the condition is true. In this challenge you need to repeat the blocks until number of dots is equal to 1.
Programming Reminders

Output statements

Output a string directly
Blocks showing how to output a string
Output a variable
Blocks showing how to output a variable

Variables

Set a variable as a string
Blocks showing how to set a variable as a string
Set a variable as an integer
Blocks showing how to set a variable as an integer
Set a variable from a calculation
Blocks showing how to set a variable from a calculation
Set a variable from a user input (text)
Blocks showing how to set a variable from a user input (text)
Set a variable from a user input (number)
Blocks showing how to set a variable from a user input (number)
Add one to a value
Blocks showing how to add one to a value

Conditionals

Find out the discount on fruit
Blocks showing how to use conditional blocks

Loops

Output string 10 times
Blocks showing how to output a string
Output number until number reaches 10
Blocks showing how to output a string
Recommended Blocks
Number block
String block
Ask and wait for number block
Say block
Divide block
Equality block
Set variable to block
Custom variable block
Repeat until block

Create your program in the editor below

Your submission results will be displayed here

Input Expected output Received output Status
32
32
16
8
4
2
1

                
Not yet run ?
128
128
64
32
16
8
4
2
1

                
Not yet run ?
1
1

                
Not yet run ?