Support promotions without the = as well
This commit is contained in:
parent
f8d47a3b73
commit
3c5c1ff1bc
|
@ -348,11 +348,11 @@
|
|||
if (move.slice(index, index + 1) === '=') {
|
||||
index++;
|
||||
switch (move.slice(index, index + 1)) {
|
||||
case 'K':
|
||||
case 'Q':
|
||||
case 'B':
|
||||
case 'N':
|
||||
case 'R':
|
||||
case 'K':
|
||||
case 'P':
|
||||
promotion = move.slice(index, index + 1);
|
||||
break;
|
||||
|
@ -360,6 +360,9 @@
|
|||
return {error: 'Unrecognized piece: ' + move.slice(index, index + 1)};
|
||||
}
|
||||
index++;
|
||||
} else if (['K', 'Q', 'B', 'N', 'R', 'P'].includes(move.slice(index, index + 1))) {
|
||||
promotion = move.slice(index, index + 1);
|
||||
index++;
|
||||
}
|
||||
|
||||
// Check(mate)
|
||||
|
|
Loading…
Reference in New Issue