diff --git a/src/components/Turing/TuringLog.tsx b/src/components/Turing/TuringLog.tsx index 20f9d0de..fceb6ccb 100644 --- a/src/components/Turing/TuringLog.tsx +++ b/src/components/Turing/TuringLog.tsx @@ -84,9 +84,13 @@ export const TuringLog: React.FC<{ embedded?: boolean }> = ({ ? 'White was the bot' : game.result?.bot === 'black' ? 'Black was the bot' - : // Not the game's result: it would give the - // answer away before the guess. - 'Awaiting your guess'} + : game.termination.winner === 'white' + ? 'White wins' + : game.termination.winner === 'black' + ? 'Black wins' + : game.termination.winner === 'none' + ? 'Draw' + : 'Game in progress'}

{game.result?.ratingDiff !== undefined && (
diff --git a/src/pages/turing.tsx b/src/pages/turing.tsx index da6e772f..fc1e3412 100644 --- a/src/pages/turing.tsx +++ b/src/pages/turing.tsx @@ -114,11 +114,6 @@ const Turing: React.FC = (props: Props) => { }, } - // The result stays hidden until the guess is in: who won, and how (a - // checkmate or a resignation), says much about which side was the bot. - const resultShown = !!game.result - const termination = resultShown ? game.termination : undefined - const launchContinue = useCallback(() => { const fen = controller.currentNode?.fen @@ -140,17 +135,15 @@ const Turing: React.FC = (props: Props) => { iconClassName="!text-xs" />
- {termination && ( - - {termination.winner === 'white' ? ( - 1 - ) : termination.winner === 'black' ? ( - 0 - ) : ( - ½ - )} - - )} + + {game.termination.winner === 'white' ? ( + 1 + ) : game.termination.winner === 'black' ? ( + 0 + ) : ( + ½ + )} +
@@ -161,28 +154,26 @@ const Turing: React.FC = (props: Props) => { iconClassName="!text-xs" />
- {termination && ( - - {termination.winner === 'black' ? ( - 1 - ) : termination.winner === 'white' ? ( - 0 - ) : ( - ½ - )} - - )} + + {game.termination.winner === 'black' ? ( + 1 + ) : game.termination.winner === 'white' ? ( + 0 + ) : ( + ½ + )} +
-
- - {termination - ? termination.winner !== 'none' - ? `${termination.winner} wins` - : 'draw' - : 'Result shown after your guess'} - -
+ {game.termination && ( +
+ + {game.termination.winner !== 'none' + ? `${game.termination.winner} wins` + : 'draw'} + +
+ )} ) @@ -234,7 +225,7 @@ const Turing: React.FC = (props: Props) => {
@@ -301,7 +292,7 @@ const Turing: React.FC = (props: Props) => {