tblackjack
v0.4.2
Published
A simple blackjack game for the terminal
Downloads
442
Readme
tBlackjack 🎲
A terminal-based Blackjack game built with Ink and ♠️ ink-playing-cards ♥️
Features 🎯
Core Gameplay
- 🎲 Standard Blackjack rules with dealer hit on soft 17
- 🎨 Beautiful terminal UI using React Ink
- 🃏 Realistic playing card rendering
- ⚡️ Fast and responsive gameplay
Interactive Experience
- 🤖 Animated dealer AI with personality
- 💭 Real-time dealer thought process
- 🎮 Intuitive keyboard controls
- 📊 Real-time game statistics
- 🔄 Smart deck management with shuffle animations
Game Features
- 📈 Session statistics tracking
- 🎯 Hand evaluation and scoring
- 📖 Built-in help and instructions
- 🎨 Color-coded messages and status updates
Installation 💻
Play instantly with npx
npx tblackjack
Or install globally
npm install -g tblackjack
How to Play 🎮
Start the game:
tblackjack
Controls:
S
- Stand (end your turn)H
- Hit (draw a card)N
- New game (after round ends)TAB
- Toggle statisticsQ
- Quit game
During welcome screen:
S
- Start gameH
- Toggle helpQ
- Quit game
Game Rules 📋
Card Values
- 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)
Gameplay
- 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
Actions
- Hit: Draw another card
- Stand: End your turn
Winning
- 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
Development 🛠️
Prerequisites
- Node.js (v14 or higher)
- npm or yarn
Setup
Clone the repository:
git clone https://github.com/gfargo/tblackjack.git cd tblackjack
Install dependencies:
npm install
Start development mode:
npm run dev
Building
npm run build
Testing
npm test
Contributing 🤝
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
License 📄
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments 🙏
- Built with Ink
- Card rendering powered by ink-playing-cards
- Inspired by classic terminal games
Support 💖
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!