In the last section of the Gomoku tutorial, titled "Implement rules and end of game conditions", there is the section:
I'm not even sure where to start really, whether it should be written in game.php or in the js file.
Nowhere in the tutorial does it show the code for checkForWin(). I can try writing one myself but the point of the tutorials seems to be to present all of the code necessary. I'm not sure if I'm ready yet to implement the check. Can anybody share the relevant function?add the appropriate code in .game.php before proceeding to the next state, using a checkForWin() function implemented separately for clarity. If the game has been won, we set the score, send a score update notification to the client side, and set the 'end_of_game' global variable to 1 as a flag signaling that the game has ended.
I'm not even sure where to start really, whether it should be written in game.php or in the js file.