UNPKG

tambola

Version:

Professional Tambola/Housie Game Standard Ticket Generator with CLI and comprehensive API

272 lines (205 loc) โ€ข 8.82 kB
# ๐ŸŽฏ Tambola - Professional Tambola/Housie Ticket Generator [![npm version](https://img.shields.io/npm/v/tambola.svg)](https://www.npmjs.com/package/tambola) [![Build Status](https://img.shields.io/github/actions/workflow/status/geek4teck/tambola/build.yml?branch=main)](https://github.com/geek4teck/tambola/actions/workflows/build.yml) [![Test Coverage](https://img.shields.io/badge/coverage-80%25-brightgreen)](https://github.com/geek4teck/tambola) [![License: ISC](https://img.shields.io/badge/License-ISC-blue.svg)](LICENSE) [![Node.js](https://img.shields.io/badge/node-%3E%3D16.0.0-brightgreen.svg)](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!** [![GitHub stars](https://img.shields.io/github/stars/geek4teck/tambola?style=social)](https://github.com/geek4teck/tambola/stargazers) [![NPM downloads](https://img.shields.io/npm/dm/tambola.svg)](https://www.npmjs.com/package/tambola) </div>