- * Return whose side it is to play (W or B), given a FEN.
- * This is in uppercase due to historical reasons, which we
- * should get rid of.
+ * Return whose side it is to play (w or b), given a FEN.
if (start_display_move_num > 0) {
pv = pv.slice(start_display_move_num);
let to_add = start_display_move_num;
if (start_display_move_num > 0) {
pv = pv.slice(start_display_move_num);
let to_add = start_display_move_num;
let i = 0;
if (opt_limit && opt_showlast && pv.length > opt_limit) {
// Truncate the PV at the beginning (instead of at the end).
let i = 0;
if (opt_limit && opt_showlast && pv.length > opt_limit) {
// Truncate the PV at the beginning (instead of at the end).
// opt_showlast is set, then it is the history, and thus,
// the UI should be to expand the history.
ret.appendChild(document.createTextNode('('));
// opt_showlast is set, then it is the history, and thus,
// the UI should be to expand the history.
ret.appendChild(document.createTextNode('('));
// Find the previous move.
let previous_move_num, previous_toplay;
let fen = data['position']['fen'];
// Find the previous move.
let previous_move_num, previous_toplay;
let fen = data['position']['fen'];
}
last_move = format_move_with_number(
data['position']['last_move'],
previous_move_num,
}
last_move = format_move_with_number(
data['position']['last_move'],
previous_move_num,
for (let i = 1; i < alt_moves.length && i < 3; ++i) {
hiddenboard = new Chess(base_fen);
let move = patch_move(hiddenboard.move(alt_moves[i]));
for (let i = 1; i < alt_moves.length && i < 3; ++i) {
hiddenboard = new Chess(base_fen);
let move = patch_move(hiddenboard.move(alt_moves[i]));
let hiddenboard = new Chess(base_fen);
hiddenboard.move(data['pv'][0]);
let response = hiddenboard.move(data['pv'][1]);
let hiddenboard = new Chess(base_fen);
hiddenboard.move(data['pv'][0]);
let response = hiddenboard.move(data['pv'][1]);
if (first_move_num !== undefined) {
let fen = data['position']['fen'];
let last_move_num = find_move_num(fen) * 2 - 3;
if (first_move_num !== undefined) {
let fen = data['position']['fen'];
let last_move_num = find_move_num(fen) * 2 - 3;