Merge tiles
A polished sliding-merge puzzle with a seeded board, scored merges, a win and a stuck state, and a golden mid-game frame.
This is a browser game spec on Spekkr, published by nova. It is listed with the other specs. Paste the line to an agent that can open a web address, and the agent fetches the files and builds from them.
- Spec
nova/merge-tiles- Version
- 0.2.2
- Published by
- nova
- Updated
- 15 Nov 2026
Build this spec
Build the spec at https://spekkr.com/nova/merge-tiles/start.md.
Paste this to your AI agent. It opens the address, fetches the spec's files, records your choices and builds from them. Nothing to install, no account.
Published by nova.
What does the result look like?
What can I customize?
Your choices go into the line you copy. Anything else is yours to edit, but it leaves the tested path.
What do I get?
-
spec.mdRequirements and acceptance checks.Merge tiles
What this builds
A sliding-tile merge game on a square board. Tiles slide until they hit an edge or another tile. Two tiles of the same value that collide merge into one tile of twice the value, once per tile per move, and the score grows by that new value. A 2048 tile is a win the person can keep playing past. A board with no legal move is stuck. The feel is tight and original; the art and typography are new. This is not a reskin of someone else's build.
Read
spekkr.inputs.jsonfirst.titlelabels the board.start_tilesis how many tiles are placed at the start.sizeis 4 or 5.animationsandundochange the chrome. New tiles after a move use a seed.Out of scope
- A copyrighted clone of a named commercial game, or its art.
- Network, accounts, or a global leaderboard in the checks.
- A board larger than 5 in this version.
Requirements
Each requirement has an id. Checks name the id they cover.
R1. Moves and merges
- A move is one of four directions. Every tile slides as far as it can. Two equal tiles merge at most once per move.
- The score increases by the value of each new merged tile.
- After a move that changed the board, a new tile appears in a random empty cell: a 2 with probability 9/10, a 4 with 1/10, from the seed.
Accept when: the merge fixtures in
design.mdproduce the stated boards and scores, including a case where a tile would otherwise merge twice.R2. Seed, win, stuck
- Seed 17 on a 4 by 4 board with 2 start tiles produces the starting board in
fixtures/merge-seed-17.txt. - A 2048 tile sets a win flag; play may continue. A board with no legal move in any direction is stuck.
- The mid-game script
fixtures/merge-midgame.jsonreaches a documented board, score, and at least one 64 tile.
Accept when: the seed-17 start matches, the mid-game script matches, a fixture board with a 2048 is flagged won, and a fixture full board with no neighbours equal is stuck.
R3. Chrome and files
- If
undois on, one undo restores the board and score from before the last move; a second undo does nothing. - Animations, if on, last 120 ms; tests may apply a move atomically.
- One command runs the fixtures and writes start, mid-game, a merge frame, and a stuck frame. No network.
Accept when: undo restores the mid-game board's previous position, and the four frames match the goldens.
R4. Inputs
- The build reads
spekkr.inputs.json. Settings label the UI, options turn features on or off, and a swap must be one of its choices. - A value outside a stated range, or a swap that is not one of its choices, is refused before the app starts its checks, with a message that names the key.
Accept when: the default inputs render, an illegal swap is refused by name, and changing a visible setting (for example the title) shows up in a later check.
Verification
Merge and score tests cover single merges, a row that must not chain twice in one move, and the documented scores. A seeded board is used for the start and for a mid-game script. Win (a 2048 tile) and stuck states are tested. A golden mid-game screenshot is checked. No network and no third-party art.
Definition of done
- Every acceptance check above runs from one command, and all pass at the person's inputs.
- A README says how to play, how to pin a seed, and how to run the checks.
# Merge tiles ## What this builds A sliding-tile merge game on a square board. Tiles slide until they hit an edge or another tile. Two tiles of the same value that collide merge into one tile of twice the value, once per tile per move, and the score grows by that new value. A 2048 tile is a win the person can keep playing past. A board with no legal move is stuck. The feel is tight and original; the art and typography are new. This is not a reskin of someone else's build. Read `spekkr.inputs.json` first. `title` labels the board. `start_tiles` is how many tiles are placed at the start. `size` is 4 or 5. `animations` and `undo` change the chrome. New tiles after a move use a seed. ## Out of scope - A copyrighted clone of a named commercial game, or its art. - Network, accounts, or a global leaderboard in the checks. - A board larger than 5 in this version. ## Requirements Each requirement has an id. Checks name the id they cover. ### R1. Moves and merges - A move is one of four directions. Every tile slides as far as it can. Two equal tiles merge at most once per move. - The score increases by the value of each new merged tile. - After a move that changed the board, a new tile appears in a random empty cell: a 2 with probability 9/10, a 4 with 1/10, from the seed. Accept when: the merge fixtures in `design.md` produce the stated boards and scores, including a case where a tile would otherwise merge twice. ### R2. Seed, win, stuck - Seed 17 on a 4 by 4 board with 2 start tiles produces the starting board in `fixtures/merge-seed-17.txt`. - A 2048 tile sets a win flag; play may continue. A board with no legal move in any direction is stuck. - The mid-game script `fixtures/merge-midgame.json` reaches a documented board, score, and at least one 64 tile. Accept when: the seed-17 start matches, the mid-game script matches, a fixture board with a 2048 is flagged won, and a fixture full board with no neighbours equal is stuck. ### R3. Chrome and files - If `undo` is on, one undo restores the board and score from before the last move; a second undo does nothing. - Animations, if on, last 120 ms; tests may apply a move atomically. - One command runs the fixtures and writes start, mid-game, a merge frame, and a stuck frame. No network. Accept when: undo restores the mid-game board's previous position, and the four frames match the goldens. ### R4. Inputs - The build reads `spekkr.inputs.json`. Settings label the UI, options turn features on or off, and a swap must be one of its choices. - A value outside a stated range, or a swap that is not one of its choices, is refused before the app starts its checks, with a message that names the key. Accept when: the default inputs render, an illegal swap is refused by name, and changing a visible setting (for example the title) shows up in a later check. ## Verification Merge and score tests cover single merges, a row that must not chain twice in one move, and the documented scores. A seeded board is used for the start and for a mid-game script. Win (a 2048 tile) and stuck states are tested. A golden mid-game screenshot is checked. No network and no third-party art. ## Definition of done - Every acceptance check above runs from one command, and all pass at the person's inputs. - A README says how to play, how to pin a seed, and how to run the checks.
-
design.mdMerge rules, the seeded start, and the mid-game script.Design
This file fixes the parts that are easy to get wrong. The language and tools are up to you, as long as the numbers here hold.
Merge fixtures
The cases are
fixtures/merge-cases.json: a slide into an empty row; two 2s becoming a 4 and scoring 4; a row2 2 2 2becoming4 4 . .(not a- and scoring 8; a row
4 4 8 8becoming8 16 . .and scoring 24.
Seed 17 start (4 by 4, 2 start tiles)
The board file is the authority. New tiles after each move of the mid-game script also use this seed, continuing from the start.
Screenshot tolerance
8 levels, 98% of pixels. Mid-game is taken at the end of the script, animations settled.
Inputs
Key Label Default Notes titleTitle Slide and merge Shown above the board. start_tilesTiles at the start 2 2 or 3. Each is a 2, or a 4 with the odds in design.md. animationsAnimate slides on Moves ease. Tests may jump to the end of a move. undoOne undo on A control restores the previous board and score once. sizeBoard size 4 A 4 by 4 or 5 by 5 board. Acceptance at the defaults
The numbers, names and fixture paths already in this file are the authority. Where a later table or a shipped fixture file disagrees with prose, the table or the fixture wins.
Fixture Role fixtures/merge-cases.jsonA shipped fixture. The build may move it, but then design.mdmust name the new path.fixtures/merge-midgame.jsonA shipped fixture. The build may move it, but then design.mdmust name the new path.fixtures/merge-seed-17.txtA shipped fixture. The build may move it, but then design.mdmust name the new path.spekkr.inputs.jsonA shipped fixture. The build may move it, but then design.mdmust name the new path.Golden frames are compared at 1400 by 1000 CSS pixels unless a requirement names another size. Tolerance, unless a tighter figure is given above: 8 levels, 98% of pixels, with motion, cursors and clocks frozen as this file says. A build's goldens are of that build; they do not have to match a shipped reference preview pixel-for-pixel if the tool or the type is different, but they do have to match this file's layout, counts and copy.
Screenshots
These pictures are headless-Chrome captures of the working reference in
reference/preview.html, at the default inputs. They are not drawings of a product that has not been built. The first picture is the one Spekkr shows on the spec's card. A build may ship its own goldens; those goldens are of that build and do not have to match these frames pixel-for-pixel.File What it shows shots/board.pngA mid-run seeded board, score 1 248, a 64 already on the grid. How to verify
- Run the checks at the default inputs, without a network.
- Walk through the scripted playthroughs, fixture lookups or goldens named in the requirements; each must match this file.
- Repeat once at the person's inputs when they differ from the defaults.
- Merge and score tests cover single merges, a row that must not chain twice in one move, and the documented scores. A seeded board is used for the start and for a mid-game script. Win (a 2048 tile) and stuck states are tested. A golden mid-game screenshot is checked. No network and no third-party art.
# Design This file fixes the parts that are easy to get wrong. The language and tools are up to you, as long as the numbers here hold. ## Merge fixtures The cases are `fixtures/merge-cases.json`: a slide into an empty row; two 2s becoming a 4 and scoring 4; a row `2 2 2 2` becoming `4 4 . .` (not a 8) and scoring 8; a row `4 4 8 8` becoming `8 16 . .` and scoring 24. ## Seed 17 start (4 by 4, 2 start tiles) The board file is the authority. New tiles after each move of the mid-game script also use this seed, continuing from the start. ## Screenshot tolerance 8 levels, 98% of pixels. Mid-game is taken at the end of the script, animations settled. ## Inputs | Key | Label | Default | Notes | | --- | --- | --- | --- | | `title` | Title | Slide and merge | Shown above the board. | | `start_tiles` | Tiles at the start | 2 | 2 or 3. Each is a 2, or a 4 with the odds in design.md. | | `animations` | Animate slides | on | Moves ease. Tests may jump to the end of a move. | | `undo` | One undo | on | A control restores the previous board and score once. | | `size` | Board size | 4 | A 4 by 4 or 5 by 5 board. | ## Acceptance at the defaults The numbers, names and fixture paths already in this file are the authority. Where a later table or a shipped fixture file disagrees with prose, the table or the fixture wins. | Fixture | Role | | --- | --- | | `fixtures/merge-cases.json` | A shipped fixture. The build may move it, but then `design.md` must name the new path. | | `fixtures/merge-midgame.json` | A shipped fixture. The build may move it, but then `design.md` must name the new path. | | `fixtures/merge-seed-17.txt` | A shipped fixture. The build may move it, but then `design.md` must name the new path. | | `spekkr.inputs.json` | A shipped fixture. The build may move it, but then `design.md` must name the new path. | Golden frames are compared at 1400 by 1000 CSS pixels unless a requirement names another size. Tolerance, unless a tighter figure is given above: 8 levels, 98% of pixels, with motion, cursors and clocks frozen as this file says. A build's goldens are of that build; they do not have to match a shipped reference preview pixel-for-pixel if the tool or the type is different, but they do have to match this file's layout, counts and copy. ## Screenshots These pictures are headless-Chrome captures of the working reference in `reference/preview.html`, at the default inputs. They are not drawings of a product that has not been built. The first picture is the one Spekkr shows on the spec's card. A build may ship its own goldens; those goldens are of that build and do not have to match these frames pixel-for-pixel. | File | What it shows | | --- | --- | | `shots/board.png` | A mid-run seeded board, score 1 248, a 64 already on the grid. | ## How to verify 1. Run the checks at the default inputs, without a network. 2. Walk through the scripted playthroughs, fixture lookups or goldens named in the requirements; each must match this file. 3. Repeat once at the person's inputs when they differ from the defaults. 4. Merge and score tests cover single merges, a row that must not chain twice in one move, and the documented scores. A seeded board is used for the start and for a mid-game script. Win (a 2048 tile) and stuck states are tested. A golden mid-game screenshot is checked. No network and no third-party art.
- and scoring 8; a row
-
tasks.mdBuild tasks in order, each with a check.Tasks
Work in order. Finish a task's check before starting the next.
- Set up. Set up a web app (or the stack you have chosen) and a test runner that can open a page, click, and compare screenshots. Read
spekkr.inputs.jsonfirst. Check: a blank or heading page loads, and an empty test run passes. - Moves and merges (R1). Build what
R1. Moves and mergesasks for, to the numbers indesign.md. In particular: A move is one of four directions. Every tile slides as far as it can. Two equal tiles merge at most once per move. Check: theR1. Moves and mergesacceptance checks pass. - Seed, win, stuck (R2). Build what
R2. Seed, win, stuckasks for, to the numbers indesign.md. In particular: Seed 17 on a 4 by 4 board with 2 start tiles produces the starting board infixtures/merge-seed-17.txt. Check: theR2. Seed, win, stuckacceptance checks pass. - Chrome and files (R3). Build what
R3. Chrome and filesasks for, to the numbers indesign.md. In particular: Ifundois on, one undo restores the board and score from before the last move; a second undo does nothing. Check: theR3. Chrome and filesacceptance checks pass. - Inputs (R4). Build what
R4. Inputsasks for, to the numbers indesign.md. In particular: The build readsspekkr.inputs.json. Settings label the UI, options turn features on or off, and a swap must be one of its choices. Check: theR4. Inputsacceptance checks pass. - Goldens. Capture the frames named in
design.mdat the defaults, with motion frozen where the file says so. Compare them within the stated tolerance. Check: the frames match, and a pixel-level check fails if a documented element is removed on purpose. - Finish. Write a README that says how to install what is needed, how to change the inputs, and how to run the checks. Run the one command from a clean folder. Check: every item under Definition of done in
spec.mdis true.
# Tasks Work in order. Finish a task's check before starting the next. 1. **Set up.** Set up a web app (or the stack you have chosen) and a test runner that can open a page, click, and compare screenshots. Read `spekkr.inputs.json` first. Check: a blank or heading page loads, and an empty test run passes. 2. **Moves and merges (R1).** Build what `R1. Moves and merges` asks for, to the numbers in `design.md`. In particular: A move is one of four directions. Every tile slides as far as it can. Two equal tiles merge at most once per move. Check: the `R1. Moves and merges` acceptance checks pass. 3. **Seed, win, stuck (R2).** Build what `R2. Seed, win, stuck` asks for, to the numbers in `design.md`. In particular: Seed 17 on a 4 by 4 board with 2 start tiles produces the starting board in `fixtures/merge-seed-17.txt`. Check: the `R2. Seed, win, stuck` acceptance checks pass. 4. **Chrome and files (R3).** Build what `R3. Chrome and files` asks for, to the numbers in `design.md`. In particular: If `undo` is on, one undo restores the board and score from before the last move; a second undo does nothing. Check: the `R3. Chrome and files` acceptance checks pass. 5. **Inputs (R4).** Build what `R4. Inputs` asks for, to the numbers in `design.md`. In particular: The build reads `spekkr.inputs.json`. Settings label the UI, options turn features on or off, and a swap must be one of its choices. Check: the `R4. Inputs` acceptance checks pass. 6. **Goldens.** Capture the frames named in `design.md` at the defaults, with motion frozen where the file says so. Compare them within the stated tolerance. Check: the frames match, and a pixel-level check fails if a documented element is removed on purpose. 7. **Finish.** Write a README that says how to install what is needed, how to change the inputs, and how to run the checks. Run the one command from a clean folder. Check: every item under Definition of done in `spec.md` is true.
- Set up. Set up a web app (or the stack you have chosen) and a test runner that can open a page, click, and compare screenshots. Read
-
reference/preview.htmlA working reference preview of the default view, used to make the listing pictures. A build does not have to start from this file. -
reference/fonts/fonts.cssWebfont faces for the reference preview. -
reference/fonts/Geist.ttfGeist variable typeface for the reference preview. -
reference/fonts/Fraunces.ttfFraunces variable typeface for the reference preview. -
reference/fonts/Fraunces-Italic.ttfFraunces italic variable typeface for the reference preview.
Is it for me?
- Kind
- browser game
- Platforms
- web
- Tools
- TypeScript
What does it need?
- Agent permissions
- shell
- Commands it runs
install a test runnerinstall a tool that compares screenshots
What changed?
- 0.2.215 Nov 2026Names what it builds.
- 0.2.114 Nov 2026Add animated loop to the listing shots.
- 0.2.014 Nov 2026Polished reference preview and new listing shots, including a short loop.
- 0.1.014 Nov 2026First version.
For agents: start.md says how to build this spec, spec.json holds everything on this page, and bundle.tar.gz holds its files.