Skip to content

Tic-tac-toe, also known as Xs and Os, is a classic two-player game where participants take turns marking spaces on a three-by-three grid with either an 'X' or an 'O'. This Android app is designed for two players, enabling them to enjoy this timeless game together on their mobile devices.

Notifications You must be signed in to change notification settings

Paniz-Peiravani/Tic-Tac-Toe

Repository files navigation

Tic Tac Toe


Tic-tac-toe, also known as Xs and Os, is a classic two-player game where participants take turns marking spaces on a three-by-three grid with either an 'X' or an 'O'. This Android app is designed for two players, enabling them to enjoy this timeless game together on their mobile devices.

Android Studio

.xml sections

Jump on to xml sections in Android Studio for app design:

activity_add_players.xml -> which is the design for the first page when a user opens the app.
https://github.com/Paniz-Peiravani/Tic-Tac-Toe/blob/master/app/src/main/res/layout/activity_add_players.xml

activity_main.xml -> which is the design for player to play the game.
https://github.com/Paniz-Peiravani/Tic-Tac-Toe/blob/master/app/src/main/res/layout/activity_main.xml

activity_result_dialog.xml -> which is the last design page that shows the winner of the game.
https://github.com/Paniz-Peiravani/Tic-Tac-Toe/blob/master/app/src/main/res/layout/activity_result_dialog.xml

.java sections

Jump on to .java in Android Studio for java classes:

AddPlayers.java -> This class allows users to input the names of two players before starting a Tic-Tac-Toe game. It captures the names and passes them to the main game activity.
https://github.com/Paniz-Peiravani/Tic-Tac-Toe/blob/master/app/src/main/java/com/example/tictactoe/AddPlayers.java

MainActivity.java -> This class defines the logic for a Tic-Tac-Toe game. It manages winning combinations, player turns, and game results.
https://github.com/Paniz-Peiravani/Tic-Tac-Toe/blob/master/app/src/main/java/com/example/tictactoe/MainActivity.java

ResultDialog.java -> This custom dialog class displays a result message in a dialog box. It allows the user to restart the game when they click the "Start Again".
https://github.com/Paniz-Peiravani/Tic-Tac-Toe/blob/master/app/src/main/java/com/example/tictactoe/ResultDialog.java

App Overview

First, it asks players to enter their names. After they enter their names, they can start the game by clicking the "Start The Game" button.


Next, they will see the game section of the app where they can begin playing.


Once the game finishes, they will see the results, and they can start a new game by clicking the "Start Again" button.

Language and Tools

About

Tic-tac-toe, also known as Xs and Os, is a classic two-player game where participants take turns marking spaces on a three-by-three grid with either an 'X' or an 'O'. This Android app is designed for two players, enabling them to enjoy this timeless game together on their mobile devices.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages