-
Play with a friend on the same device or face off against an artificial intelligence with varying difficulty levels.
- (Integration with Google's Gemini AI models). This is optional.
Get your API key here:
https://aistudio.google.com/app/apikey
CreateBoard
Create the Tic Tac Toe board in an HVArrangement.
Restart
Restart the game.

GameMode
Set the game mode (TwoPlayer or Ai).
AIDifficulty
Set the AI difficulty (Easy, Medium, Hard).
Easy: 70% random moves, 30% smart moves.
Medium: 50% random, 50% smart moves.
Hard:
-
With API Key: Uses Gemini AI for strategic decisions.
-
Without API Key: Uses 100% of the internal intelligent logic.
PlayerSymbol
Set the player symbol (X or O) in Ai mode.
SymbolImages
Set images for X and O symbols.
ClearSymbolImages
Clear symbol images and return to using X and O.

GeminiApiKey
Set the Gemini AI API Key
GeminiModel
Specify the Gemini AI model to use.
- It supports multiple models: gemini-2.5-flash, gemini-2.0-flash, etc...
RemoveBoard
Remove the board from the container.

Colors
Change the colors of the X and O.

BackgroundColor
Sets the background color of the cells.
BorderColor
Set the color of the board border.
BorderWidth
Sets the border thickness.
Padding
Sets the padding (space from the edge) for the X and O.
StrokeWidth
Sets the line thickness for X and O.
WinLineColor
Set the color of the winning line.
WinLineWidth
Set the thickness of the winning line.
PlayerXScore
Get player X score

PlayerOScore
Get player O score.

CurrentPlayer
Gets the current player.

IsGameActive
Check if the game is active.

IsAIThinking
Check if the AI is thinking.

GameEnded
It triggers when a player wins.

PlayerChanged
It triggers when the player changes.

GameRestarted
It triggers when the game restarts.

CellClicked
It is triggered when a cell is clicked.

AIThinkingStarted
It triggers when the AI starts to think.

AIThinkingFinished
It fires when the AI finishes thinking.
v1.0 March 11, 2026.
TicTacToe.aia (56.0 KB)
joejsanz.joedevtictactoe.aix (40.2 KB)
JDK: 11
Minimum API Level: 21
Updated On: 2026-03-11T07:00:00Z
Built using: FAST-CLI v5.7.0-premium
Thanks.

















