return true;
}
- broadcast_move(square) {
- this.broadcast_event("move", square);
+ broadcast_move(move) {
+ this.broadcast_event("move", move);
}
}
router.post('/move', (request, response) => {
const game = request.game;
- const square = request.body.move;
+ const move = request.body.move;
- const legal = game.add_move(square);
+ const legal = game.add_move(move);
/* Inform this client whether the move was legal. */
response.send(JSON.stringify(legal));
if (! legal)
return;
- game.broadcast_move(square);
+ game.broadcast_move(move);
});
exports.router = router;