tambola
Version:
Professional Tambola/Housie Game Standard Ticket Generator with CLI and comprehensive API
272 lines (205 loc) โข 8.82 kB
Markdown
# ๐ฏ Tambola - Professional Tambola/Housie Ticket Generator
[](https://www.npmjs.com/package/tambola)
[](https://github.com/geek4teck/tambola/actions/workflows/build.yml)
[](https://github.com/geek4teck/tambola)
[](LICENSE)
[](https://nodejs.org/)
> **The Ultimate Tambola/Housie Ticket Generator for Node.js** ๐
Generate professional Tambola tickets and draw sequences with **zero dependencies**, **lightning-fast performance**, and **100% official game rule compliance**. Perfect for game organizers, developers, and anyone who needs reliable Tambola ticket generation.
## โจ Why Choose Tambola?
### ๐ฏ **Official Game Compliance**
- โ
Follows all official Tambola/Housie game rules
- โ
Validates ticket structure and number distribution
- โ
Ensures proper column ranges and ascending order
- โ
Generates exactly 15 numbers per ticket (5 per row)
### โก **Lightning Fast Performance**
- ๐ **1000+ tickets per second** on modern hardware
- ๐ **10,000+ sequences per second** for draw simulation
- ๐ **Zero dependencies** - lightweight and fast
- ๐ **Memory efficient** - no memory leaks
### ๐ ๏ธ **Developer Friendly**
- ๐ฆ **Simple API** - just two functions to get started
- ๐ฅ๏ธ **CLI Support** - command-line interface included
- ๐ **Multiple Formats** - JSON, CSV, and table output
- ๐งช **Comprehensive Testing** - 84+ tests with 80%+ coverage
### ๐ **Production Ready**
- ๐ **Cross-platform** - works on all Node.js platforms
- ๐ **Node.js 16+** compatibility
- ๐ **CI/CD Pipeline** - automated testing and deployment
- ๐ **Active Maintenance** - regular updates and improvements
## ๐ Quick Start
### Installation
```bash
npm install tambola
```
### Basic Usage
```javascript
const tambola = require('tambola');
// Generate a professional Tambola ticket
const ticket = tambola.generateTicket();
console.log(ticket);
// Output: [[2, 0, 22, 0, 0, 56, 0, 71, 81], [0, 13, 0, 34, 45, 0, 65, 0, 88], [7, 19, 0, 39, 0, 59, 67, 0, 0]]
// Generate a random draw sequence (1-90)
const sequence = tambola.getDrawSequence();
console.log(sequence);
// Output: [37, 2, 89, 15, 73, 41, 8, 56, 23, ...]
```
### Command Line Interface
```bash
# Generate a ticket
npx tambola ticket
# Generate 5 tickets in JSON format
npx tambola ticket -c 5 -f json
# Generate draw sequence
npx tambola sequence
# Save to file
npx tambola ticket -o my_tickets.json
```
## ๐ฎ Perfect For
### ๐ข **Event Organizers**
- Generate hundreds of tickets for corporate events
- Create backup draw sequences
- Export to various formats for printing
- Ensure fair and random ticket distribution
### ๐จโ๐ป **Developers**
- Integrate into web applications
- Build Tambola game apps
- Create automated ticket systems
- Add to existing game platforms
### ๐ฏ **Game Enthusiasts**
- Organize family Tambola nights
- Create custom game variations
- Generate practice tickets
- Learn official game rules
### ๐ซ **Educational Institutions**
- Teach probability and statistics
- Organize student events
- Create educational games
- Demonstrate random number generation
## ๐ Performance Benchmarks
| Operation | Speed | Memory Usage |
|-----------|-------|--------------|
| Ticket Generation | 1,000+ tickets/sec | ~216 bytes/ticket |
| Draw Sequence | 10,000+ sequences/sec | ~720 bytes/sequence |
| CLI Operations | Instant response | Minimal overhead |
| Batch Processing | 100,000+ items/min | Efficient memory usage |
## ๐ฏ Real-World Examples
### Event Management System
```javascript
const tambola = require('tambola');
// Generate tickets for a 500-person event
const eventTickets = [];
for (let i = 0; i < 500; i++) {
eventTickets.push(tambola.generateTicket());
}
// Generate backup draw sequences
const drawSequences = [];
for (let i = 0; i < 3; i++) {
drawSequences.push(tambola.getDrawSequence());
}
console.log(`Generated ${eventTickets.length} tickets and ${drawSequences.length} draw sequences`);
```
### Web Application Integration
```javascript
const express = require('express');
const tambola = require('tambola');
const app = express();
app.get('/api/ticket', (req, res) => {
const ticket = tambola.generateTicket();
res.json({ ticket, timestamp: new Date().toISOString() });
});
app.get('/api/sequence', (req, res) => {
const sequence = tambola.getDrawSequence();
res.json({ sequence, timestamp: new Date().toISOString() });
});
```
## ๐ Documentation
### ๐ **Complete Documentation**
- **[๐ API Reference](docs/API_REFERENCE.md)** - Complete API documentation with examples
- **[๐ฅ๏ธ CLI Guide](docs/CLI_GUIDE.md)** - Command-line interface usage
- **[๐ฎ Game Rules](docs/GAME_RULES.md)** - Official Tambola/Housie rules
- **[๐งช Testing Guide](docs/TESTING_GUIDE.md)** - Testing documentation
- **[๐ค Contributing](docs/CONTRIBUTING.md)** - How to contribute
### ๐ **Quick Links**
- **[๐ฆ NPM Package](https://www.npmjs.com/package/tambola)** - Install from npm
- **[๐ GitHub Repository](https://github.com/geek4teck/tambola)** - Source code
- **[๐ GitHub Actions](https://github.com/geek4teck/tambola/actions)** - CI/CD status
- **[๐ Issues](https://github.com/geek4teck/tambola/issues)** - Report bugs & request features
## ๐ Features at a Glance
| Feature | Description | Benefit |
|---------|-------------|---------|
| **Official Compliance** | Follows all Tambola rules | Legitimate game tickets |
| **High Performance** | 1000+ tickets/second | Fast batch processing |
| **Zero Dependencies** | No external packages | Lightweight & secure |
| **CLI Support** | Command-line interface | Easy automation |
| **Multiple Formats** | JSON, CSV, Table | Flexible output |
| **Comprehensive Tests** | 84+ tests, 80%+ coverage | Reliable & stable |
| **Cross-Platform** | Works everywhere | Universal compatibility |
| **Active Maintenance** | Regular updates | Long-term support |
## ๐ฏ Use Cases
### ๐ข **Corporate Events**
- Team building activities
- Holiday parties
- Fundraising events
- Client entertainment
### ๐ **Family Gatherings**
- Birthday parties
- Holiday celebrations
- Weekend entertainment
- Educational activities
### ๐ฎ **Game Development**
- Mobile apps
- Web games
- Educational software
- Gaming platforms
### ๐ **Data Analysis**
- Probability studies
- Random number research
- Statistical analysis
- Algorithm testing
## ๐ง Technical Specifications
- **Node.js**: >= 16.0.0
- **Package Size**: < 50KB
- **Memory Usage**: Minimal
- **Dependencies**: Zero
- **License**: ISC
- **Platform**: Cross-platform
## ๐ Getting Started
### 1. Install the Package
```bash
npm install tambola
```
### 2. Generate Your First Ticket
```javascript
const tambola = require('tambola');
const ticket = tambola.generateTicket();
console.log('Your Tambola ticket:', ticket);
```
### 3. Try the CLI
```bash
npx tambola ticket
npx tambola sequence
```
### 4. Explore Documentation
Visit the [๐ Complete Documentation](docs/README.md) for detailed guides and examples.
## ๐ค Contributing
We welcome contributions! Whether you're fixing bugs, adding features, or improving documentation, your help is appreciated.
- ๐ **[Contributing Guide](docs/CONTRIBUTING.md)** - How to contribute
- ๐ **[Report Issues](https://github.com/geek4teck/tambola/issues)** - Bug reports & feature requests
- ๐ฌ **[Discussions](https://github.com/geek4teck/tambola/discussions)** - Questions & community help
## ๐ License
This project is licensed under the [ISC License](LICENSE) - see the license file for details.
## ๐จโ๐ป Author
**Vishal Goyal** - [GitHub](https://github.com/geek4teck)
---
## ๐ฏ Ready to Get Started?
```bash
npm install tambola
```
**Join thousands of developers and game organizers who trust Tambola for their ticket generation needs!** ๐
---
<div align="center">
**โญ Star this repository if you find it useful!**
[](https://github.com/geek4teck/tambola/stargazers)
[](https://www.npmjs.com/package/tambola)
</div>