improved solitaire

This commit is contained in:
Milo
2025-07-24 14:10:16 +02:00
parent 611dece6f1
commit 93bad3863a
2 changed files with 19 additions and 7 deletions

View File

@@ -4503,6 +4503,7 @@ app.post('/solitaire/move', (req, res) => {
// If valid, mutate the state
moveCard(gameState, req.body);
const win = checkWinCondition(gameState);
if (win) gameState.isDone = true
res.json({ success: true, gameState, win });
} else {
// If the move is invalid, send a specific error message