- Tournament Mode - Compete against AI players with increasing blind levels
- Cash Game Mode - Flexible play with buy-in/top-up system
- Complete Texas Hold'em rules implementation
- Multi-player support (2-8 players)
- Advanced betting system (check, call, raise, fold, all-in)
- Buy-in and top-up support for cash games
- Session tracking and profit analysis
| Character | Style | VPIP | Aggression | Description |
|---|---|---|---|---|
| 🪨 Rock | Tight-Aggressive | 15% | High | Plays only premium hands |
| 😈 Maniac | Loose-Aggressive | 55% | Very High | Bets constantly, never folds |
| 👩 Anna | Loose-Passive | 40% | Very Low | Calls everything, never raises |
| 🦊 Fox | Balanced | 45% | Medium | Hard to read, strategic play |
| 🦈 Shark | Position-Play | 45% | High | Exploits position, harvests fish |
| 👩🏫 Amy | GTO-Math | 50% | Medium | Mathematical optimal play |
| 😤 David | Tilt-Based | Dynamic | Dynamic | Emotional player, can go on tilt |
- Monte Carlo simulation for win rate calculation
- ICM (Independent Chip Model) for tournament play
- Position-based strategy adjustment
- Opponent modeling and profiling
- Bluff frequency and timing optimization
- Hands played
- Win rate by position
- VPIP/PFR tracking
- Session history
- Performance graphs
- Cash game profit/loss tracking
- Session duration and stats
| Layer | Technology |
|---|---|
| Language | Swift 5.9+ |
| UI Framework | SwiftUI (iOS 15+) |
| State Management | Combine + ObservableObject |
| Architecture | MVVM + Finite State Machine |
| Persistence | Core Data + UserDefaults |
| Testing | XCTest |
TexasPoker/
├── App/
│ └── TexasPokerApp.swift # App entry point
│
├── Core/
│ ├── AI/
│ │ ├── AIProfile.swift # AI personality definitions
│ │ ├── DecisionEngine.swift # AI decision making
│ │ ├── BluffDetector.swift # Bluff probability
│ │ ├── ICMCalculator.swift # Tournament equity
│ │ ├── MonteCarloSimulator.swift # Win rate calculation
│ │ ├── OpponentModeler.swift # Player profiling
│ │ ├── RangeAnalyzer.swift # Hand range analysis
│ │ └── DifficultyManager.swift # AI difficulty levels
│ │
│ ├── Data/
│ │ ├── PersistenceController.swift # Core Data stack
│ │ ├── StatisticsCalculator.swift # Stats computation
│ │ ├── ProfileManager.swift # Player profile management
│ │ ├── DataMigrationManager.swift # Schema migration
│ │ ├── ActionRecorder.swift # Hand history
│ │ └── DataExporter.swift # Export functionality
│ │
│ ├── Engine/
│ │ ├── PokerEngine.swift # Main game loop
│ │ ├── HandEvaluator.swift # Hand strength evaluation
│ │ ├── BettingManager.swift # Betting logic
│ │ ├── DealingManager.swift # Card dealing
│ │ ├── ShowdownManager.swift # Win determination
│ │ ├── TournamentManager.swift # Tournament logic
│ │ ├── CashGameManager.swift # Cash game logic
│ │ ├── GameResultsManager.swift # Result calculation
│ │ └── TiltManager.swift # Emotional state tracking
│ │
│ ├── FSM/
│ │ ├── GameState.swift # State definitions
│ │ ├── GameEvent.swift # Game events
│ │ └── PokerGameStore.swift # State machine
│ │
│ ├── Models/
│ │ ├── Card.swift # Card model
│ │ ├── Deck.swift # Deck management
│ │ ├── Player.swift # Base player
│ │ ├── HumanPlayer.swift # Human player
│ │ ├── AIPlayer.swift # AI player wrapper
│ │ ├── Pot.swift # Pot model
│ │ ├── ActionLogEntry.swift # Action logging
│ │ ├── BlindLevel.swift # Blind structure
│ │ ├── GameRecord.swift # Game records
│ │ ├── GameSettings.swift # Game settings
│ │ ├── GameMode.swift # Game mode enum
│ │ ├── TournamentConfig.swift # Tournament config
│ │ ├── CashGameConfig.swift # Cash game config
│ │ ├── CashGameSession.swift # Cash game session
│ │ └── more models...
│ │
│ └── Utils/
│ ├── ColorTheme.swift # UI theming
│ ├── DeviceHelper.swift # Device adaptation
│ └── Constants.swift # App constants
│
├── UI/
│ ├── Components/
│ │ ├── CardView.swift # Card visualization
│ │ ├── ChipStackView.swift # Chip stack display
│ │ ├── FlippingCard.swift # Card flip animation
│ │ └── ActionButtons.swift # Game actions
│ │
│ └── Views/
│ ├── GameTableView.swift # Main table view
│ ├── PlayerView.swift # Player info display
│ ├── ControlPanel.swift # Player controls
│ ├── SettingsView.swift # Settings screen
│ ├── StatisticsView.swift # Stats dashboard
│ ├── RankingsView.swift # Leaderboards
│ └── GameSubviews/ # Sub-components
│ ├── GameTopBar.swift
│ ├── GamePotDisplay.swift
│ ├── GameHeroControls.swift
│ ├── GameActionLogPanel.swift
│ ├── GameTournamentInfo.swift
│ ├── BuyInView.swift
│ ├── TopUpView.swift
│ ├── LeaveTableButton.swift
│ └── CashSessionSummaryView.swift
│
├── Resources/
│ ├── Assets.xcassets
│ ├── Sounds/
│ └── Data/
│
└── TexasPokerTests/
├── Core/
│ └── Engine/
│ ├── HandEvaluatorTests.swift
│ └── PokerEngineTests.swift
├── UI/
│ ├── ColorThemeTests.swift
│ └── GameViewLayoutTests.swift
├── CashGameConfigTests.swift
├── CashGameManagerTests.swift
├── CashGameSessionTests.swift
└── UncalledBetTests.swift
- macOS 14+ or macOS 15+ (Apple Silicon recommended)
- Xcode 15+
- iOS 15.0+ Simulator or Device
# Clone the repository
git clone https://github.com/yourusername/ios-poker-game.git
cd ios-poker-game
# Open in Xcode
open TexasPoker.xcodeproj
# Select a simulator and run (Cmd+R)xcodebuild -project TexasPoker.xcodeproj \
-scheme TexasPoker \
-destination 'platform=iOS Simulator,name=iPhone 15' \
-configuration Debug \
build- Launch the app
- Select game mode (Cash Game / Tournament)
- Choose opponents (1-7 AI players)
- Set buy-in amount
- Press "Deal" to start
- Check: Available when no bet pending
- Call: Match the current bet
- Raise: Increase the bet
- Fold: Surrender the hand
- All-In: Commit all chips
Each AI opponent can be customized:
- Personality profile
- Starting stack
- Difficulty level
- Avatar selection
# Run all tests
xcodebuild test -project TexasPoker.xcodeproj \
-scheme TexasPoker \
-destination 'platform=iOS Simulator,name=iPhone 15'
# Run specific test class
xcodebuild test -project TexasPoker.xcodeproj \
-scheme TexasPoker \
-destination 'platform=iOS Simulator,name=iPhone 15' \
-only-testing:TexasPokerTests/Core/Engine/HandEvaluatorTests┌─────────────────────────────────────────────────────────┐
│ Game States │
├─────────────────────────────────────────────────────────┤
│ idle → preFlop → flop → turn → river → showdown │
│ ↑ │
│ └───loop (new hand) │
└─────────────────────────────────────────────────────────┘
Player Action
↓
Game Context (pot, position, hand strength)
↓
AI Decision Engine
├── Check hand strength (Monte Carlo)
├── Calculate pot odds
├── Apply personality adjustments
└── Select action (weighted random)
↓
Execute Action
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- SwiftUI - Apple's modern UI framework
- Combine - Reactive programming framework
- XCTest - Testing framework
Made with ❤️ by the Poker AI Team


