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.

Score0 Lines0 Combox1 Best0
press start( 

Close the innermost bracket first: the last one opened is the first one closed.

Ready for a quick break?

You have 30 seconds. Each closed line adds time, a wrong bracket takes two seconds away. Keys: ) ] } >, or tap the buttons.

How to play Bracket Blitz

  1. Press Start game. A line such as map(users[{ appears with its brackets still open.
  2. 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.
  3. A finished line scores points and adds time to the clock. A wrong bracket costs two seconds and resets your combo.
  4. Lines get longer as you go. The game ends when the time bar runs out; your best score is kept in this browser.

Scoring

ActionEffect
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

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.

Related tools