DEV Community

Discussion on: Material vs locked: the rule that lets 2048 and Sudoku share a board

Collapse
 
ayoolasolomon profile image
Ayoola Solomon • • Edited

Thanks. That’s a cleaner framing: the invariant sits on the value once locked, not on the cell the moment it’s occupied. Deferring uniqueness to seal is what stops spawn and merge from fighting Sudoku.

v1 only checks legality, not solvability. Seal asks whether this digit would duplicate a locked tile in the same row, column, or box. Win is a full validation when every cell is already locked. Loss is no legal spawn, merge, or seal left. There is no candidate or forward check after seal.

That dead end is real and intentional here. You can seal a board that is locally legal and globally doomed; undo is the recovery. I left forward checking out on purpose, so soft-locks stay part of the merge economy instead of sliding the game toward a solver. A “warn on doomed seal” assist is interesting for Daily later