Skip to content

Conversation

@pol2rd
Copy link

@pol2rd pol2rd commented Dec 21, 2025

No description provided.

@pol2rd pol2rd changed the title added game logic liron's pr Dec 21, 2025
Copy link

@ShirYahav ShirYahav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work


},[timeLeft])

function checkCombination(comb: number[], newSquares: (string | null)[]): Boolean {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Boolean → use lowercase boolean for TypeScript consistency

<Square value={props.squares[6]} onClick={() => props.onSquareClick(6)} isDisabled={props.squares[6] != null || props.isGameOver}/>
<Square value={props.squares[7]} onClick={() => props.onSquareClick(7)} isDisabled={props.squares[7] != null || props.isGameOver}/>
<Square value={props.squares[8]} onClick={() => props.onSquareClick(8)} isDisabled={props.squares[8] != null || props.isGameOver}/>
</div>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid repetition here, render the squares with map to keep the code DRY and easier to maintain.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(DRY - Don't Repeat Yourself)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants