Code: Select all
if (this.mistakes) {
if (Math.random() <= 1.0/(this.uci.spec.depth * this.uci.spec.depth)) {
var mm = Math.random() + Math.random();
this.uci.debug('blunder, changed score of ',board.formatMove(move,SAN_FMT),' from ',score,' to ',score*mm|0);
score = score * mm | 0;
}
}
It means that every move is tweaked when playing at Level 1 (I wanted to make sure that Level 1 can be beaten by literally everybody) and every 16th move at Level 4.
While this seems to work fine, I was wondering if there is a better/standard way to force blunders?
Try the new user interface here: https://op12no2.github.io/lozza-ui/play.htm
To see the effect on top levels moves you can use the console UI: https://op12no2.github.io/lozza-ui/console.htm
Type for example:-
Code: Select all
start
uci
ucinewgame
position startpos
debug on
mistakes 1
board
go depth 5