Magnet Blocks

Saved games stay in this browser only.

About the game

Each stage is a square grid, a bit like a small board of letters and dashes. Some cells already hold a magnet, shown in grey as "N", a few dashes and an "S", and some are blocked by "#". Your job is to cover every remaining empty cell with more magnets. A magnet is a straight bar of at least three cells with its north pole (N) at one end and its south pole (S) at the other.

The one rule is that a north pole may not sit next to another north pole, and a south pole may not sit next to another south pole, in any of the four directions. That sounds easy until the grid fills up and the last few gaps only fit in one way. You place a magnet by dragging from where the N should go to where the S should go, and a tap on one of your magnets takes it back off the grid. A timer runs from the first stage to the tenth, and the grid gets a little bigger as you go.

Magnet Blocks is one of the one-button mini-games that Kenta Cho, who works as ABA Games, makes with his crisp-game-lib library. There are no image or sound files: the graphics are drawn by the code, and the sound effects and music are generated while you play.

Playing it here

Click Play, then click or tap inside the game to start. The clock at the top left runs through all ten stages, and the counter at the bottom left shows which stage you are on. Nothing is installed or sent anywhere. The best score at the top right is only remembered while the page stays open.

Controls

Input Action
Drag (mouse or touch) place a magnet from its N end to its S end
Tap one of your magnets take it off the grid

A few things worth knowing

Start from the tightest corner. A cell with only one free neighbour can only be the end of a bar.

Mind the red X. While you drag, an X means the spot is not allowed: wrong direction, too short, or a like pole next to it.

Do not be afraid to undo. A tap on a placed magnet removes it, so try a layout and take it back if the rest does not fit.

Credits and licence

Magnet Blocks was made by Kenta Cho (ABA Games) and published under the MIT licence in the crisp-game-lib-11-games repository. The licence texts of the game, of crisp-game-lib and of the libraries that come with it are linked from this page. The game files are served as published, with only the starting page replaced so that nothing is loaded from other sites.