14 / 15 PROJECT
Every projectTexas Hold'em Poker in Haskell
A complete Texas Hold'em game in pure Haskell: hand evaluation, blinds, betting rounds, tie-breaking, and four AI strategies to play against.
- 4
- distinct ai strategies
- Haskell
- pure, immutable throughout
- Dec 2024
- project date
Every hand, ranked
The evaluator covers the whole ladder, royal flush down to high card. Ranking is only half of it: two players can hold the same category and still not split the pot, so every category carries its own comparison rule. Above that sits winner determination across several tied players at once.
Four ways to play
Four distinct strategies ship with it: Random, Passive, Aggressive and Smart. A human can sit at the same table, and human input is validated before it reaches the game. The deck is shuffled and dealt with proper randomisation, which is one of the places the program has to step outside pure functions.
There is no mutable state to fall back on, so the whole game is a value passed forward and returned changed.
Blinds, bets, elimination
The table runs the full loop rather than one hand in isolation. Small and big blinds post each round; fold, check, call and raise each carry the constraints that make them legal; chips are tracked per player and the dealer rotates. Players are eliminated when they run out, and rounds continue on top of that state, so the game runs to a result.
State without mutation
There is no mutable state to fall back on, so the whole game is a value passed forward and returned changed. Shuffling the deck needs randomness and asking a human to act needs input, so those parts sit in a monadic layer while the rules underneath stay pure functions over immutable data.
What it does
- 01Complete poker hand evaluation system (Royal Flush to High Card)
- 02Four distinct AI strategies: Random, Passive, Aggressive, and Smart
- 03Human player interaction with input validation
- 04Full betting mechanics (fold, check, call, raise) with proper constraints
- 05Comprehensive tie-breaking system for all hand types
- 06Proper blind system implementation (small/big blinds)
- 07Multi-round gameplay with chip tracking and dealer rotation
- 08Advanced functional programming patterns and monadic IO
- 09Deck shuffling and card dealing with proper randomization
- 10Complete game state management and player elimination
- 11Sophisticated winner determination with multiple tied players
- 12Pure functional implementation with immutable data structures
Built with
- Haskell
- Functional Programming
- Game Development
- AI
- Random Generation
- Monadic Programming