- 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


