The Tic-tac-toe app is a simple implementation of the classic game for two players.
This game app allows the players to take turns placing their symbols ('X' and 'O') on a 3x3 grid until one player wins or the game ends in a draw. Like the classic game here also the rules for winning are that players place there symbols consecutively either horizontally, vertically or diagonally.
The app is built using React Native and consists of multiple components and utility files.
To use the Tic-tac-toe app, follow these steps:
- Ensure you have React Native and its dependencies set up on your development machine.
- Clone the project repository and navigate to the project directory.
- Run
npm install
oryarn
to install the required dependencies. - Connect a device or start an emulator/simulator.
- Run
yarn start
ornpm start
- Run
npx react-native run-android
oryarn react-native run-android
(for Android) ornpx react-native run-ios
oryarn react-native run-ios
(for iOS) to launch the app.
Once the app is running, you can enter the palyer names and then proceed to play yhe Tic-tac-toe by tapping on the cells to place your symbols. The game board and other relevant information will be displayed on the screen. When the game ends, an alert dialog will appear, allowing you to start a new game.
The app is composed of the following components:
- App: The root component of the app. It manages the game state and renders the other components.
- Route : Used for navigating from users to game
- Users : Allows users to enter their names and start the game.
- GameBoard: Renders the game board UI, including the cells and handles user interactions.
- Description: Displays game-related information, such as the game name and current player's turn.
- Alert: Shows a alert dialog when the game ends, displaying the winner or indicating a draw.Also allowing user to restart the game.
The app also includes the following utility files:
- TextLiterals: Contains constant strings used in the app, such as game names and messages.
- CommonStyles: Defines common styles and dimensions used throughout the app.
- Functions: Defines common functions and hooks used throughout the app.
This app can be customized and extended in several ways:
- Game Logic: The game logic can be modified to introduce additional features or rules, such as different win conditions or game modes.
- UI Styling: The app's visual appearance can be customized by modifying the styles defined in the components' style objects.
- PlayerInfo: Provides information about the players, such as their names and can be enhanced
This app is developed using various open-source libraries and resources. The following are the main technologies used:
- React Native: https://reactnative.dev/
- TypeScript: https://www.typescriptlang.org/.
- React: https://react.dev/
- Wikipedia: https://en.wikipedia.org/wiki/Tic-tac-toe
23-05-21-23-25-00.mp4
Use this information as a guide to understand and make modifications to the app according to your needs. Enjoy playing Tic-tac-toe!