diff --git a/public/icons/forced.png b/public/icons/forced.png new file mode 100644 index 0000000..e34ba39 Binary files /dev/null and b/public/icons/forced.png differ diff --git a/src/lib/engine/helpers/moveClassification.ts b/src/lib/engine/helpers/moveClassification.ts index 2f0b300..a9bf856 100644 --- a/src/lib/engine/helpers/moveClassification.ts +++ b/src/lib/engine/helpers/moveClassification.ts @@ -29,6 +29,15 @@ export const getMovesClassification = ( }; } + const prevPosition = rawPositions[index - 1]; + if (prevPosition.bestMove && prevPosition.lines.length <= 1) { + return { + ...rawPosition, + opening: currentOpening, + moveClassification: MoveClassification.Forced, + }; + } + const playedMove = uciMoves[index - 1]; const bestMove = rawPositions[index - 1].bestMove; diff --git a/src/types/enums.ts b/src/types/enums.ts index 78bc6aa..e537bdb 100644 --- a/src/types/enums.ts +++ b/src/types/enums.ts @@ -21,6 +21,7 @@ export enum MoveClassification { Good = "good", Excellent = "excellent", Best = "best", + Forced = "forced", Book = "book", Great = "great", Brilliant = "brilliant",