Skip to main content
Mouhssine Lakhili

Puzzle game

Tidal Puzzle

A puzzle game where the tide decides which lines you can move.

Each turn, the tide floods one row and one column of a 6×6 beach, and only those lines can move. Slide one, line up three identical shells or more, and collect them. Out of the water, shells dry in the sun: for a while they are worth three times more, then they turn to stone. The game goes on until the beach is lost, and the aim is your best score.

Built with: React 19, TypeScript, Pointer Events, Web Animations API, node:test, localStorage

The game opens full screen. Close it with the × button, Escape or your browser's Back button: it is saved in this browser and resumes where you left it.

The rules

  • Tides

    Each turn floods one row and one column. One tide in eight is a spring tide (two rows and two columns), and a neap tide floods a single line. The next four tides are always shown.

  • Moves

    Slide a flooded line by one or two cells, either way: what leaves one end comes back at the other. Stones never move, and shells hop over them. You can also pass.

  • Matches

    Three identical shells or more in a row or a column are collected, for 10 points each. Nothing falls and nothing chains: each turn is resolved once.

  • Drying

    Out of the water, a shell dries one level per turn. Ripe, then cracked, it is worth 30 points. On its fourth dry turn it turns to stone; back in the water, it is wet again.

  • Erosion

    A stone next to a collected shell crumbles back into sand. Lining up shells against stones is how you win back space.

  • New shells and the end

    Two shells wash up each turn, on flooded cells first, and you know which ones are coming. The game ends when the beach is full or holds more than 12 stones.

Controls

Play with a mouse, a finger or the keyboard. Only flooded lines can move.

ShortcutAction
Drag a flooded lineSlide it by one or two cells, then let go to play
Tap a flooded lineSelect it; at a crossing, tap again to switch between the row and the column
TabMove from one flooded line to the next
← / →Slide the selected row (press twice for two cells)
↑ / ↓Slide the selected column (press twice for two cells)
EnterPlay the move
PPass: let the tide turn without moving anything
EscCancel the move, or close the game
?Open the help

How it's built

The rules live in a small TypeScript engine with no React and no DOM: pure functions that take a game and an action, and return the next game with a report of what happened. The interface only plays that report back as animations, so turning them off changes nothing.

Everything random comes from a seed. Each tide, each new shell and each landing cell is drawn from its own counter-based stream: the forecast is exactly what will happen, and a saved game is just a seed and a list of moves, replayed when you come back.

  • The engine is covered by unit tests run with Node's built-in test runner, and by simulated games that check its invariants.
  • For screen readers, the board is a real table with a description of every cell, and each turn is summed up.
  • Drag a line with a finger or a mouse, or play with the keyboard alone.
  • The game is only downloaded when you open it, so this page stays light.

Your game stays in this browser

Your best scores, the game in progress and whether you have seen the tutorial are kept in this browser's localStorage, under a single key: portfolio:mini-games:tide-puzzle:v1. They are never sent to a server, and there is no account.

If your browser blocks storage, the game still works and simply forgets everything when you leave the page. To erase your scores, clear this site's data in your browser settings.

Visitor statistics

To know whether these pages find readers, their traffic is measured with Vercel Web Analytics, the analytics tool of the site's host. Each page view sends Vercel the page address and, if you followed a link from another site, that site's address; from my checks, no cookie is set. Vercel derives an approximate location, the device type, the operating system and the browser, for overall traffic statistics only. There is no Google Analytics here, and nothing you do in the game is sent: no score, no move, no game state. To stop being counted, use “Cookie settings” at the bottom of every page.

Frequently asked questions

Is Tidal Puzzle free? Do I need an account?

It is free and there is no account. The game runs entirely in your browser, with no ads. Only visits to the page are counted, with Vercel Web Analytics: nothing you do in the game is sent.

How long does a game last?

As long as you keep the beach alive: a game only ends when the board is full or more than 12 stones have formed. It lasts from about ten turns to several dozen, depending on how far ahead you plan.

Can I play on a phone?

Yes. Drag a flooded line with your finger and let go to play, or use the buttons under the board. The layout adapts to small screens, upright or sideways.

Can I play with a keyboard or a screen reader?

Yes. Tab moves between the flooded lines, the arrow keys slide the selected one and Enter plays. The board is exposed as a table that describes every cell, each turn is summed up, and animations follow your reduced motion setting.

Is my game saved?

Yes, in this browser only. Closing the game, reloading the page or coming back later resumes it, and your best score is kept for each level. Your game and scores never leave your device.

What is the difference between the two levels?

Standard has four kinds of shells. Hard adds a fifth, so lines of three are rarer. The rules are otherwise the same, and each level keeps its own best score.

Does this project speak to you?

I'm available for a permanent role and for freelance missions. Let's talk about your team or your project.

All mini projects