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 (