A Threes-style sliding merge puzzle, built with Flutter -- deliberately distinct from a 2048 clone in its core mechanic, not just its skin.
- Swipe or use arrow keys. Each tile moves at most one cell per swipe (no sliding all the way to the wall).
- 1 and 2 are a special pair: they merge into 3. Same-value tiles of 3 or higher merge by addition (3+3=6, 6+6=12, ...) -- but two 1s or two 2s never merge with each other.
- The game ends when the board is full and no adjacent pair can merge. Best score is saved locally.
lib/game_logic.dart— pure-DartThreesGameengine. The one-cell slide is implemented as a single left-to-right pass per row/column, resolving each adjacent pair once using the state as it stands when that pair's turn comes up -- which is what prevents a tile from cascading multiple cells through a run of empty space in one swipe (a real subtlety worth getting right, verified directly in the tests below). No Flutter imports, fully unit-testable.lib/screens/game_screen.dart— grid UI, keyboard + swipe input.lib/services/score_service.dart— best-score persistence viashared_preferences.lib/theme/app_theme.dart— light Material 3 theme.
test/widget_test.dart verifies the mechanics directly: a tile moves
exactly one cell (not all the way to the wall), the 1+2=3 special merge,
same-value merging at 3+, that two 1-tiles do not merge, the no-moves-left
end condition (and that any empty cell means moves remain), and that a
fully blocked move is rejected and leaves the board untouched -- plus a
widget test for the intro overlay.
flutter test
flutter pub get
flutter run -d windows # or any supported platform