A terminal-based Blackjack game built with Ink and
- 🎲 Standard Blackjack rules with dealer hit on soft 17
- 🎨 Beautiful terminal UI using React Ink
- 🃏 Realistic playing card rendering
- ⚡️ Fast and responsive gameplay
- 🤖 Animated dealer AI with personality
- 💭 Real-time dealer thought process
- 🎮 Intuitive keyboard controls
- 📊 Real-time game statistics
- 🔄 Smart deck management with shuffle animations
- 📈 Session statistics tracking
- 🎯 Hand evaluation and scoring
- 📖 Built-in help and instructions
- 🎨 Color-coded messages and status updates
Play instantly with npx
npx tblackjack
Or install globally
npm install -g tblackjack
-
Start the game:
tblackjack
-
Controls:
-
S
- Stand (end your turn) -
H
- Hit (draw a card) -
N
- New game (after round ends) -
TAB
- Toggle statistics -
Q
- Quit game
During welcome screen:
S
- Start gameH
- Toggle helpQ
- Quit game
-
- Number cards (2-10) are worth their face value
- Face cards (J, Q, K) are worth 10
- Aces are worth 1 or 11 (automatically optimized)
- Try to get as close to 21 as possible without going over
- Dealer must hit on soft 17 (Ace counted as 11)
- Dealer must stand on hard 17 or higher
- Blackjack (Ace + 10-value card) beats regular 21
- Hit: Draw another card
- Stand: End your turn
- Beat the dealer's hand without going over 21
- Win automatically if dealer busts (goes over 21)
- Push (tie) if your score equals dealer's
- Lose if you bust or dealer has higher score
- Node.js (v14 or higher)
- npm or yarn
-
Clone the repository:
git clone https://github.com/gfargo/tblackjack.git cd tblackjack
-
Install dependencies:
npm install
-
Start development mode:
npm run dev
npm run build
npm test
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
- 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.
- Built with Ink
- Card rendering powered by ink-playing-cards
- Inspired by classic terminal games
If you find this project helpful, please consider giving it a ⭐️ on GitHub!
Want to contribute? Check out our Contributing Guidelines or pick up one of the roadmap items!