Black Box (Simon Tatham's Puzzles)
Saved games stay in this browser only.
About the puzzle
Black Box hides a few balls somewhere in a square arena that you cannot see into. All you can do is shine a beam in from one of the squares around the edge and see what happens to it: it might cross straight over, come out somewhere unexpected after turning a corner or two, come straight back, or never come out at all. From those results you have to work out where every ball is.
The game was invented by Eric Solomon and sold as a board game by Waddingtons in 1977, and it later appeared on the Acorn Atom and the BBC Micro. James Harvey contributed this version to the collection.
Rules
- A beam travels in a straight line from where it enters until it leaves the box, unless a ball gets in the way.
- A beam that runs head on into a ball is absorbed. The edge square shows an H (hit).
- A beam that passes diagonally next to a ball, with no ball straight ahead, turns 90 degrees away from it. Two balls at once on its front left and front right turn it back the way it came.
- A beam that comes out where it went in, or that is turned away before it even enters because a ball sits diagonally next to its entry point, shows an R (reflection).
- Any other beam marks its entry and exit squares with the same number, so you can see which edge square leads to which.
- Once you have placed as many guesses as there are balls, a button lets you check them. Your answer counts if it explains every beam the same way as the real one, even when the balls could be arranged in more than one way.
Controls
| Input | Action |
|---|---|
| Left click on an edge square | fire a beam (click a fired square again to highlight its path ends) |
| Left click inside the box | place or remove a guessed ball |
| Right click | lock a square, or a whole row or column from its edge square, against changes |
| Arrow keys | move the cursor |
| Enter | fire a beam or place a ball at the cursor |
| Space | lock the square, row or column at the cursor |
| N / U / R | new game / undo / redo |
The check button appears in the top left corner of the grid when you have placed enough balls. If your guess is wrong, the game circles one beam your layout cannot explain, or, if everything you fired fits, reveals one new beam in red that proves you wrong.
How to solve it
A straight path clears three lines. A beam that crosses the box and comes out exactly opposite never met a ball ahead of it or diagonally beside it. That means its own row or column is empty, and so are the squares on both sides of its path. Lock them so you stop thinking about them.
An R at the edge points to a corner. A beam that is reflected on entry has a ball on one of the two squares diagonally in front of its edge square. Firing the neighbouring edge squares usually tells you which one.
An H gives a line, not a square. The beam ended against a ball, but it may have turned first. Fire from the other end of the same line, and from the lines next to it, to see whether it went straight in and how far.
Follow the bends. A numbered pair tells you that the beam turned, and every turn needs a ball diagonally in front of the turning point. Sketch possible paths and see which ball positions explain the most beams at once.
Check the edges of your guess. Before pressing the check button, fire the edge squares you have not tried yet in your head against your layout. If one would behave differently from what the game already showed, your layout is wrong.
Sizes
The Type menu has a 5x5 box with 3 balls, 8x8 boxes with 5 balls or with anywhere from 3 to 6, and 10x10 boxes with 5 balls or with 4 to 10. When the number of balls is a range, you do not know exactly how many are hidden. Custom sets the width, height and number of balls, either a single number or a range like 2-6.
Playing here
Click Play to open the puzzle. The menu above the board has New game, Restart, Undo, Redo and Solve (which reveals the balls and marks your mistakes), the Type menu with the sizes, and the Game menu, where you can type in a game ID or a random seed, download the current game as a file, load a saved file and change the preferences. Your game in progress is kept in this browser and comes back with its whole undo history the next time you open the page.
On a touch screen, tap an edge square to fire and tap inside the box to place a ball; turn on the Mark button above the board to lock squares instead.
Credits and licence
Black Box was written by James Harvey for Simon Tatham's Portable Puzzle Collection, which Simon Tatham maintains with code contributed by several other authors and distributes with its source code under the MIT licence. The original game is by Eric Solomon. This page runs a WebAssembly build made by FredyGames from the author's official source snapshot, with no changes to the puzzle; the source and the build script are hosted with the game, and the licence text is linked from this page.