gekro
GitHub LinkedIn

Gem Swap

Play a swap-and-match puzzle on an 8 by 8 board: line up shapes, start chains, make special pieces and beat your best score.

Score 0

Moves left 30

Best 0

  • blue circle
  • yellow square
  • pink triangle
  • green diamond
  • purple hexagon
  • orange star

Tap a piece, then tap a piece next to it to swap them. You can also slide a piece toward its neighbour. With the keyboard, Tab to the board, move with the arrow keys, press Enter or Space to pick a piece, then press an arrow key to swap it that way (Escape lets go). A swap must make a line of three or more of the same kind, in a row or a column, or it does not count and no move is used. Cleared pieces make the ones above fall, and any new lines clear too: each step of a chain is worth more (the step number, up to 8, times 10 points a piece). A line of four makes a sweeper marked with an arrow: when it is cleared it clears its whole row (the left-right arrow) or column (the up-down arrow). A line of five makes a colour clear (the ring): swap it with any neighbour to clear every piece of that kind. A cross or corner of two lines makes a burst (the star), which clears the 3 by 3 square around it. If no moves are left the board shuffles itself. Every kind has its own shape as well as its own colour. In the 60 second game the clock starts at your first swap and waits while a move plays out. Show me a move marks the game as aided, so it does not count as a best. Sound is off until you turn it on.

How it works

The board is 8 by 8. A new board is built cell by cell so that no line of three ever forms, and it is thrown away and rebuilt (from the same seed) if it has no move. After a swap the engine clears every line, lets the pieces above fall, fills the gaps from the top, and repeats until nothing lines up. A swap that makes no line is undone.

Specials are made at the piece you moved (or the middle of the line when a fall made it). When a special is part of a clearing it goes off in the same step, and any special inside its blast goes off too. Scoring is 10 points for each piece cleared times the step number, so a chain pays more every time it carries on.

As-is, no warranty. These apps are free under their listed license and run entirely in your browser. Use at your own risk — don't blame me if your PC catches fire, your dog runs away, or the math turns out wrong. Verify anything that actually matters. None of this is professional financial, medical, legal, or engineering advice.

© 2026 Rohit Burani · MIT · Built at gekro.com · View source ↗

Guide

How to play

The board is 8 by 8 and holds six kinds of piece. Each kind has its own shape and its own colour: blue circle, yellow square, pink triangle, green diamond, purple hexagon and orange star. A key under the board shows them, and you never have to tell them apart by colour alone.

Swap two pieces that touch, up and down or left and right, so that three or more of the same kind line up in a row or a column. They clear, the pieces above fall, new pieces drop in from the top, and if that makes new lines they clear too. A swap that makes no line does not count: the pieces go back and you keep your move.

  • Tap and tap. Tap a piece, then tap one next to it. Tap the same piece again to let go.
  • Slide. Press a piece and slide a little way toward a neighbour to swap in that direction.
  • Keyboard. Tab to the board and move with the arrow keys. Press Enter or Space to pick up a piece, then press an arrow key to swap it that way. Escape lets go. Every piece has a label such as “Row 2, column 3: green diamond”, and the status line says what each move did.
  • Two games. 30 moves ends after your thirtieth swap. 60 seconds starts its clock at your first swap, waits while a move plays out, and stops if you switch to another tab.
  • Show me a move marks two pieces with dashed outlines. It picks the swap that clears the most in its first step. A game where you used it does not count as a best.
  • Sound is off until you turn it on. Each step of a chain plays one short, quiet tone that climbs the scale, so a long chain sounds like it is rising.

Scoring. Every piece you clear is worth 10 points times the step of the chain: the move itself is step 1, the first chain is step 2, and so on, up to a multiplier of 8. Three pieces in step 1 score 30. The same three in step 2 score 60.

Special pieces.

What you makeYou getWhat it does
A line of 4Row sweeper or column sweeper (an arrow on the piece)When it clears, it clears its whole row or column
A line of 5Colour clear (a ring, filled with every colour)Swap it with any neighbour to clear every piece of that kind
A cross or corner of two linesBurst (a star)When it clears, it clears the 3 by 3 square around it

The special appears where you swapped. A special that is caught in the blast of another one goes off too. Two colour clears swapped together clear the whole board. If a chain leaves no moves, the board shuffles itself, keeping every piece and every special.

Light and motion. Pieces pop and fall once. Nothing loops and nothing flashes. If your device asks for reduced motion, a move shows its final board at once, with no pop, fall or shake.

How it works

The board. A new board is filled cell by cell, banning any kind that would make a third in a row with the two cells before it, so no line ever forms. If the result has no legal move, it is rebuilt from the same seed. The same seed always gives the same board. A test builds 3,000 boards and checks each has no line, at least one move, and six kinds of piece.

Finding lines. The engine scans every row and column for runs of three or more. Colour clears never take part in lines. A test compares this with a second, independent finder that checks every window of three cells, on 4,000 random boards.

Legal moves. A swap is legal if it makes a line through one of the two swapped pieces, or if one of them is a colour clear. The tests compare the engine with a search that actually performs each swap on a copy of the board and looks for lines, on 400 boards at rest and part-way through games. A board with no legal move is reshuffled; a test uses a pattern with no move at all and checks the shuffle keeps every piece, ends with a move and leaves no line.

Clearing. Each step clears the lines, makes any special pieces, sets off any special that was cleared (and any inside its blast), then lets everything fall and fills the gaps with new pieces from the seeded generator. The engine keeps going until nothing lines up. Hand-built scenes in the tests pin the exact cells cleared and points scored: a plain three, a two-step chain (30 then 60 points), a four that makes a row sweeper at the swapped cell, a vertical four, a five that makes a colour clear, a cross that makes a burst, sweepers and a burst going off, a chain of two specials, and the colour clear on a swap and in a pair.

Replays. Everything random comes from one seeded generator, so a seed and a list of swaps always give the same game, which a test proves. The engine also never clears the wrong thing at rest: after each of 6,000 swaps in the random games, the board is full, has no line, has a legal move, and every piece has its own number.

FactValueChecked by
Board8 by 8, six kindsconstant tests
Points10 per piece, times step up to 8scoring tests
Games30 moves, or 60 secondsgame tests
New boardsno line, at least one move3,000 seeds
Lines and movesmatch brute force4,000 and 400 boards
Random games150 games of 40 movesinvariant tests

What is stored

Two small whole numbers, from 1 to 9,999,999: your best score in the 30 move game and in the 60 second game. They live in your browser’s local storage in a small object. Anything else found there is ignored: the loader reads only those two keys, rejects anything that is not a whole number in range, and builds a new object. Nothing is sent anywhere, and the page works if storage is blocked. The page address holds the game type and the board number, so a link opens the same starting board.

All arcade games →

Free to play, no ads, nothing uploaded. These games are original and are not affiliated with any other game or brand.