How to play
- Read the program. It is a few lines of JavaScript, Python or HTML. Work out what it is meant to do from its name and its lines.
- Tap the line with the bug. Exactly one line is wrong. You have three tries.
- See the fix. When you find it, or after the third try, you see the correct line and one sentence on why the broken one fails.
- Share your squares. A row of squares shows how many tries you took, without giving the answer away.
Your tries are kept in this browser only. Nothing is sent anywhere.
The bugs you will meet
The puzzle plants the mistakes that programmers really make. Knowing the list makes you faster at spotting them in your own code.
| Bug | What goes wrong | Languages |
|---|---|---|
| One equals sign where a comparison belongs | A single equals sign assigns a value. It does not compare two | JavaScript, Python |
| A misspelled name | lenght for length, prnt for print, rang for range, herf for href: the computer does not guess what you meant | All three |
| A missing closing paren | The call or the condition never ends, and the line after it is read as part of it | JavaScript, Python |
| A missing brace or colon | The block that should open never does | JavaScript, Python |
| A loop that counts the wrong way | The counter moves away from the end, so the loop never finishes | JavaScript |
| A missing return | The function works out the answer and then gives nothing back | JavaScript, Python |
| A variable never declared | A name is used without let or const | JavaScript |
| Off by one | < where <= belongs: the loop stops one step early | JavaScript |
| Minus where plus belongs | The total shrinks when it should grow | JavaScript, Python |
| A tag that is not closed | A closing tag without its slash, or a tag without its final > | HTML |
How to find a bug faster
- Say what the program should do before you look for what is wrong. A bug is a difference between the two.
- Read every line to its last character. Most planted bugs are at the end of a line: a paren, a brace, a colon.
- Check the operators. One equals sign or two? Plus or minus? Less than, or less than or equal?
- Follow the value. Where is it made, where is it changed, where is it returned? A missing return hides in a line that looks finished.
- Trace a loop by hand for its first and last pass. Off-by-one bugs only show at the ends.
Every past bug, with its fix, is in the archive. We looked at which of these people miss most: Which bugs are hardest to spot?. When your own code is broken, Fix my code in the app finds the cause and walks you to the fix.
In the LoWisa app
The app has the same bug each day, with more around it: the bug arrives as a ticket that says what is going wrong, you type the fix yourself, and you can see who else in your cohort found it. See Revision games, Quick Fire and Bug of the day. To learn the language behind the bug, the courses start free.
Frequently asked questions
Is Bug of the day free?
Yes. It is free to play here in the browser every day, with no account.
Is the bug the same for everyone?
Yes. Everyone gets the same program and the same planted bug on the same day, here and in the LoWisa app.
Which programming languages does it use?
JavaScript, Python and HTML.
When does the next bug arrive?
A new bug arrives every day.