Bracket Blitz: Close the Brackets Game
A one-minute browser game for a quick break. A line of code appears with brackets left open; close them in the right order before the clock runs out. Every line is longer than the last. Play with your keyboard or the buttons below, no download or sign-up.
Close the innermost bracket first: the last one opened is the first one closed.
How to play Bracket Blitz
- Press Start game. A line such as
map(users[{appears with its brackets still open. - Close them from the inside out. For
map(users[{the answer is}, then], then). Type the closing bracket on your keyboard, or tap its button. - A finished line scores points and adds time to the clock. A wrong bracket costs two seconds and resets your combo.
- Lines get longer as you go. The game ends when the time bar runs out; your best score is kept in this browser.
Scoring
| Action | Effect |
|---|---|
| Correct closing bracket | +10 points × your combo |
| Line finished | +1.5 seconds plus 0.4 seconds per bracket, combo +1 (up to ×5) |
| Wrong bracket | −2 seconds, combo back to ×1 |
Why the last bracket opened is the first one closed
Brackets nest: whatever opens inside something else has to close before the outer one can. Programmers call this last in, first out, and it is exactly how parsers, code editors and formatters check brackets: they push every opening bracket onto a stack and pop the top one when a closing bracket arrives. If the two do not match, the code has a syntax error. The game is that check, played against the clock.
The same rule explains error messages such as Unexpected token } in JSON or JavaScript. When a formatter rejects your code, the JSON Formatter and the JavaScript Formatter point to the line where the brackets stopped matching.
Tips for a higher score
- Read the line from right to left: the rightmost open bracket is always the next one to close.
- On a keyboard, keep your fingers near the keys: ) is Shift+0 and } is Shift+] on a US layout. The game also accepts the opening key of the same pair, so ( or 9 closes a round bracket and [ closes a square one.
- Speed matters less than accuracy. A wrong bracket costs more time than a short pause.
Frequently asked questions
Is Bracket Blitz free?
Yes. It runs entirely in your browser, needs no account and does not download anything apart from this page.
Does it work on a phone or tablet?
Yes. Tap the four bracket buttons under the line. On a computer the keyboard is usually faster.
Where is my best score saved?
Only in this browser’s local storage. It is not sent to us, and clearing your site data resets it. There is no online leaderboard.
Can the game run out of new lines?
No. Every line is generated at random, so no two games are the same.