..by this I mean a logic handler for a chess game. Basically validating a move and checking if somebody has won.
For arguments sake imagine once a move is completed in the browser it sends a JSON object of the piece that has been moved and to which space it has been moved to. On the server we have access to a JSON object which contains data for the complete board. With this information I expect to pass it in to my engine and determine from the output if the move is valid..and if so is it a winning move?
I'm not looking for any specific logic on how to determine a move in chess -> just a kind of psuedo example/template of the flow of the game using the above paragraph as a guide to what must be done.
The reason for this is I would like to understand how callbacks can be used to produce something of this nature as opposed to synchronous code.
Any help is much appreciated.