Explain solidity>booleans

Booleans

In Tic Tac Toe, players take turns. We need to track whose turn it is.

The bool Type:

bool stores true or false values. Perfect for tracking states like "is it X's turn?"

Example:

bool public isGameActive = true;



For Our Game:

We'll use bool public xTurn; to track whose turn it is.

• If xTurn is true, it's X's turn

• If xTurn is false, it's O's turn



Add the xTurn variable to your contract, then initialize it to true in the startGame function (X goes first).

Add turn tracking
0%
Requirements:
Declares bool public xTurn
Initializes xTurn in startGame
Sets xTurn to true