Check out the full documentation of the project here to know how to write your AI player
1. You need to implement two functions. First, the do_move which is responsible to the basic move the AI player is doing in each turn. Second, do_continue_jump_move is the function that will run if a toy is possible to continue and jump over other toys.
2. the picked move must be assigned into the answer var. Note that re-declaration of the answer var (using either 'let' or 'var') will result in error.
3. The code must be in pure JS (don't assume any function given aside the ones in the P5.JS library).
4. If you wish to declare more functions and write complex logic, we suggest just to fork the project from here and do it outside the scope of this play ground.
5. Please try avoiding hacking into the website, this is a Front-End only host, you are able to get the code free of charge here .
game - is the game object with all the properties that are found in the documentation. allPossbileMoves - list of all possible moves the AI can pick from them.
game - is the game object with all the properties that are found in the documentation. toyId - the Id of the toy that currently playing. possibleMoves - list of all possible moves the AI can pick from them.
Note: the default AI player is set to pick a possible move in random for each turn. This is a good place to start with but this is not a good player at all.