From 6813e73b97dd4c3534f4b738b8b35134c1b8f8ae Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Fri, 22 Aug 2025 17:33:19 +0000 Subject: [PATCH] Refine parity bits interactive Update parity bits interactive to allow flipping any bit, include parity bits in highlights, display odd/even text alongside highlights, and remove red border from flipped bits. --- src/components/ParityBitsGame.tsx | 56 +++++++++++++++++++++++++------ 1 file changed, 45 insertions(+), 11 deletions(-) diff --git a/src/components/ParityBitsGame.tsx b/src/components/ParityBitsGame.tsx index 8da54fb..ce21150 100644 --- a/src/components/ParityBitsGame.tsx +++ b/src/components/ParityBitsGame.tsx @@ -97,7 +97,7 @@ const ParityBitsGame = ({ showSocialShare = true }: ParityBitsGameProps) => { // Flip a bit in the parity grid const flipBit = (row: number, col: number) => { - if (phase !== 'parity' || row >= gridSize || col >= gridSize) return; + if (phase !== 'parity') return; const newGrid = [...parityGrid]; newGrid[row][col] = !newGrid[row][col]; @@ -210,9 +210,9 @@ const ParityBitsGame = ({ showSocialShare = true }: ParityBitsGameProps) => { const isParityCell = parityBitsAdded && (row === gridSize || col === gridSize); const isFlipped = flippedCell?.row === row && flippedCell?.col === col; const isError = errorDetected?.row === row && errorDetected?.col === col; - const isCurrentRowBeingChecked = animationState.currentRow === row && !isParityCell; - const isCurrentColBeingChecked = animationState.currentCol === col && !isParityCell; - const shouldHighlightForAnimation = (isCurrentRowBeingChecked || isCurrentColBeingChecked) && currentGrid[row]?.[col]; + const isCurrentRowBeingChecked = animationState.currentRow === row; + const isCurrentColBeingChecked = animationState.currentCol === col; + const shouldHighlightForAnimation = isCurrentRowBeingChecked || isCurrentColBeingChecked; return (