Previous site

The Submarine’s Secret Code

Deep in the dark sea… what message will the submarine send to its base?

Build a cool submarine that swims in the dark sea.

The Submarine’s Secret Code
Finished model

Blocks needed

  • × 1
  • × 1
  • × 23
  • × 44
  • × 4
  • × 2
  • × 2

How to build 32 steps

  1. Step 1
  2. Step 2
  3. Step 3
  4. Step 4
  5. Step 5
  6. Step 6
  7. Step 7
  8. Step 8
  9. Step 9
  10. Step 10
  11. Step 11
  12. Step 12
  13. Step 13
  14. Step 14
  15. Step 15
  16. Step 16
  17. Step 17
  18. Step 18
  19. Step 19
  20. Step 20
  21. Step 21
  22. Step 22
  23. Step 23
  24. Step 24
  25. Step 25
  26. Step 26
  27. Step 27
  28. Step 28
  29. Step 29
  30. Step 30
  31. Step 31
  32. Step 32
1 / 32

Coding mission

Submarine mission! The submarine must send the right code before it can dive into the dark water. Hint: send rainbow-colored light!

Blocks and their jobs

  • Master BlockShows the light
  • Light Sensor BlockMeasures how much light there is

Let's think

Use a condition with the Light Sensor Block.

Put the color for when it is bright (lots of light) here.

Put the color for when it is dark (little light) here.

Find out which colors the Master Block can show.

Show the solution

Above the water, the submarine’s light (Master Block) is purple. In the dark it sends the rainbow code: red, orange, yellow, green, blue, indigo, violet. Use the endless loop block to keep checking the amount of light.

Mission complete!

Built it and coded it? Tap to save your progress.