The full negamax result behind chooseMove - the move it would play, its evaluation, and how many positions it visited to get there.
chooseMove
import { search, startingChess } from '@datamoc/mw_games/board';const result = search(startingChess(), { depth: 2 });console.log(result.move !== null); // true - the opening position always has legal movesconsole.log(typeof result.score, typeof result.nodes); // 'number' 'number' Copy
import { search, startingChess } from '@datamoc/mw_games/board';const result = search(startingChess(), { depth: 2 });console.log(result.move !== null); // true - the opening position always has legal movesconsole.log(typeof result.score, typeof result.nodes); // 'number' 'number'
The full negamax result behind
chooseMove- the move it would play, its evaluation, and how many positions it visited to get there.