Explain solidity>variables

State Variables

State variables store data permanently on the blockchain.

Common types:

address - Stores Ethereum addresses (like player addresses)

uint - Unsigned integer (positive whole numbers only)

bool - True or false values



For our Tic Tac Toe game, we need to track two players.

Write: address public playerX;

Write: address public playerO;

Note: The semicolon ; at the end marks where a statement finishes. Every statement in Solidity needs to end with a semicolon.



The public keyword automatically creates a function to read the variable.

Add player variables
0%
Requirements:
Declares address public playerX
Declares address public playerO
Both marked as public
playerX ends with semicolon
playerO ends with semicolon