Debug it with code

Find and fix the errors to make a micro:bit bedroom door sign

Debugging means finding and fixing problems with your code.  It’s an essential skill that is hard to begin with because error messages look intimidating until you know how to understand them. With practice though, you’ll become a pro at finding, fixing and avoiding common mistakes with your code.

The code below tries to scroll the message “This room belongs to Joel: KEEP OUT!” but it’s got some deliberate mistakes.

These mistakes are called syntax errors. Syntax means the rules of the programming language, so a syntax error is when you break one of those rules.

When you try to run the code, you’ll see an error message at the bottom of the screen. This is because a syntax error stops the code from running. The error message might not make much sense to you yet but at least it will tell you which line to start looking.

Hints:

  • Try to run the code. Look at the line numbers whenever you get an error.
  • Check brackets, quotation marks and spelling.