mirror of
https://github.com/cassoule/flopobot_v2.git
synced 2026-01-18 16:37:40 +01:00
improved solitaire
This commit is contained in:
1
index.js
1
index.js
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user