A React Native Tic-Tac-Toe game with an intelligent AI opponent, user profiles, and global leaderboard. Built with TypeScript, React Native, and Swift.
- Smart AI Opponent - AI uses strategy to win and block player moves
- User Profiles - Create and manage your player name
- Game Statistics - Track wins, losses, streaks, and play time
- Platform - Runs on iOS
- UI: React Native, TypeScript, React Hooks
- Logic: Swift, SwiftData, URLSession
- State Management: React Native Async Bridge
- Data Persistence: SwiftData (local),
REST API (leaderboard)
- Node.js 18+ and npm/yarn
- Ruby 2.7+ (for CocoaPods)
- Xcode 16+ (for iOS development)
git clone https://github.com/chiliec/TicTacToe.git
cd TicTacToe
npm install
First-time setup:
bundle installThen install pods:
bundle exec pod installnpm startnpm run ios- Players take turns marking spaces on a 3×3 grid
- First player to get 3 in a row (horizontal, vertical, or diagonal) wins
- If all 9 squares are filled with no winner, the game is a draw
Tap any cell to make your move. The game timer starts on your first move. The AI automatically takes its turn after you.
- Navigate to the "🏆 Rating" tab to see your stats and compete on the leaderboard
- Stats include: win/loss record, win rate, longest streak, and total playtime
Tap your username in the top-left corner of the game screen to edit it. This is used to track your stats and leaderboard position.
rm -rf ~/Library/Developer/Xcode/DerivedData
bundle exec pod install --repo-update
- Check that CocoaPods dependencies are installed:
bundle exec pod install - Verify Xcode/Android SDK are up to date
- Clear Metro cache:
npm start -- --reset-cache
- Multiplayer support (local and online)
- Different difficulty levels
- Sound effects and animations
- Persistent leaderboard synchronization
- Fork the repository
- Create a feature branch:
git checkout -b feature/my-feature - Commit changes:
git commit -am 'Add my feature' - Push to branch:
git push origin feature/my-feature - Submit a pull request
MIT License - see LICENSE file for details
For issues or questions, please open a GitHub issue.