Looks like computer moves randomly:
/*************************************************************
* Computer Move (random)
*************************************************************/
function computerMove(){
if (gameOver) return;
let wasWhite=whiteToMove;
let moves=generateLegalMoves(wasWhite);
if (moves.length===0){
detectGameState();
return;
}
let randIndex=Math.floor(Math.random()*moves.length);
let move=moves[randIndex];
makeMove(move);
renderBoard();
detectGameState();
if (!wasWhite){
fullmoveNumber++;
}
}
What could be interesting is playing against a full-strength engine, that is forced to sacrifice a piece every N moves (I initially wrote "blunder," but the top sacrificial Stockfish move would likely still be a viable strategy).
What system is it using for the “play with computer”? Is it custom or one of the available chess engines?
I wonder if there is a way to alter the difficulty of the computer program.