- JavaScript 87.8%
- CSS 8.7%
- HTML 3.5%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
|
||
| components | ||
| icons | ||
| iq | ||
| lib | ||
| locales | ||
| mathdoku | ||
| rings | ||
| splash | ||
| sudoku | ||
| test | ||
| .prettierrc.json | ||
| icon-180.png | ||
| icon-192.png | ||
| icon-512.png | ||
| index.html | ||
| main.css | ||
| main.js | ||
| manifest.json | ||
| README.md | ||
| test.html | ||
| test.js | ||
🧩 Spelhörnan
Puzzle games without ads, for the phone, offline.
Four games: Sudoku, Mathdoku, Rings and IQ test, in English, Swedish and German. Each game is kept in the browser as it is played, so closing the app loses nothing, and each offers Easy, Medium and Hard at New game.
Sudoku
Fill the grid so that every row, column and 3×3 box holds the digits 1 to 9 once each.
Tap a cell, then a digit. Erase clears the cell, and Undo takes back the last change. A digit that is already in its row, column or box shows in red.
Every puzzle is made in the browser, has exactly one solution and can be solved by logic alone, without guessing. Easy takes only singles, the one digit a cell can hold or the one cell a digit fits, and keeps 36 givens. Medium also takes pairs and digits confined to a row, column or box. Hard takes at least one of triples, an X-wing, a swordfish or an XY-wing.
Mathdoku
Fill the grid so that every row and column holds the digits from 1 to its size once each. The grid is split into cages, each with a target and an operation, +, −, × or ÷, that its digits must make; a cage of one cell gives its digit.
Tap a cell, then a digit, with Erase and Undo as in Sudoku.
Easy is 4×4, Medium 6×6 and Hard 9×9. Every puzzle has exactly one solution and can be solved by logic alone. Easy takes singles and cages with one way left to fill them. Medium also takes a cage's possible fillings, what a cage needs, and pairs. Hard takes at least one of the totals of a row or column, cages confined to lines, triples or an X-wing.
Rings
Rings with a gap lie on a hexagonal grid, joined by clips. Tap a ring to turn it; when its gap reaches a clip that holds it, it slips out, and a ring joined to nothing is gone. A ring cannot turn while its own clips hold another ring. Clear the board.
The game is played in levels of five puzzles against the clock, each level with a colour palette of its own. The levels bring more rings, less time per ring, and rings with no gap at all. When time is up, Try again gives a new puzzle in its place. Each difficulty is a journey of its own, up to a last level from which it gets no harder.
IQ test
Rocks drift in from the sides, spinning, and come to rest round the middle. Tap two rocks that are the same rock to match them.
Each level is a wave of pairs, all of one kind: the same rock the same way round; the same rock turned; or turned, with its mirror image coming as another pair, which looks alike but does not match. A rock's partner may come several rocks later. A wrong pair costs time, not score. When time is up, the pairs left count as missed, and Try again plays the level again. The levels bring more pairs, faster rocks and partners coming later.
The score is a rating on the IQ scale, starting at 100 and kept from game to game, updated after every match or miss as in Elo's rating: each kind of pair has a difficulty on that scale, set by hand rather than measured on players. It is shown as 1000 at 100, doubling every 15 points above.
Engineering
Designed and engineered by Joel Sebastian Andersson.
Co-authored with Claude by Anthropic.
Built with triad.js, with no build step: open index.html. Each game is a page of its own in its folder, such as rings/rings.html; what the games share is in the root's lib/ and components/, with main.css and main.js. The texts are in locales/. The sounds are made with the Web Audio API (lib/sound.js), so there are no files to load. The Home Screen icons and the iPhones' launch screens are rendered by node splash/generate.js.
The Sudoku and Mathdoku puzzles are solved as an exact cover problem, with Knuth's Algorithm X and dancing links from The Art of Computer Programming, Volume 4B, section 7.2.2.1 (lib/dlx.js). A Sudoku is made by solving an empty grid with the placements in a random order, then taking away givens one at a time, in a random order, keeping each removal only while the puzzle still has one solution (sudoku/lib/grid.js) and can still be solved with the level's techniques. A Mathdoku is made by solving an empty grid the same way, then drawing random cages over it until they have one solution (mathdoku/lib/cages.js), kept only if the level's techniques solve it. A puzzle is rated by solving it the way a person does, with the simplest technique that makes progress at each step (sudoku/lib/logic.js, mathdoku/lib/cageLogic.js).
In Rings, the clips form a directed graph, from the ring that owns a clip to the ring it holds, and a level can be cleared exactly when that graph has no cycle: clearing it is a topological sort, as in Algorithm 2.2.3T of The Art of Computer Programming. A level is made acyclic by choosing the order the rings will leave in, and letting each clip's owner be the ring that leaves later (rings/lib/clips.js).
In IQ test, a rock's outline is made as Attneave and Arnoult made the figures of perception tests: points strewn at random, the outermost joined, and some of the others drawn in as notches. It is kept only if it is fair: 5 to 10 corners, none sharp, no thin parts, and a mirror image unlike it turned. The rocks of a wave differ in structure and are unlike each other however turned or mirrored (iq/lib/rocks.js). iq/lib/seeds.js holds seeds with their structures, made by node iq/makeSeeds.js, so that a wave chooses rocks without making their outlines first. The pace of each level is in iq/lib/pace.js.
Tests
Each game's test.html runs its tests with testrunner: sudoku, mathdoku, rings and IQ test, and test.html the landing page's.