This repository contains a set of Rust crates for generating and simulating bingo tickets. It includes three main components: a generator for creating bingo tickets, a simulator for running bingo games, and a ticket library for handling ticket operations.
The generator
crate is responsible for creating bingo tickets. It uses random number generation to produce unique ticket configurations, ensuring a fair and varied set of tickets for each game.
The simulator
crate simulates bingo games using the generated tickets. It shuffles numbers and determines winners based on the tickets, providing a realistic simulation of a bingo game.
The ticket
crate provides utilities for reading and displaying bingo tickets. It handles file I/O and ticket formatting, making it easy to manage and present tickets in a user-friendly format.
To build and run the project, you need to have Rust and Cargo installed. You can install Rust using rustup.
Clone the repository and navigate to the project directory:
git clone <repository-url>
cd <repository-directory>
To generate bingo tickets, navigate to the generator
directory and run the following command. Replace <number_of_tickets>
with the desired number of tickets and <random_seed>
with a seed for random number generation:
cargo run --bin generator -- --size <number_of_tickets> --seed <random_seed>
To simulate bingo games, navigate to the simulator
directory and run the following command. Replace <path_to_ticket_file>
with the path to your ticket file, <number_of_raffles>
with the number of raffles to simulate, and <random_seed>
with a seed for random number generation:
cargo run --bin simulator -- --file <path_to_ticket_file> --size <number_of_raffles> --seed <random_seed>
Contributions are welcome! Please fork the repository and submit a pull request for any improvements or bug fixes.
This project is licensed under the MIT License. See the LICENSE
file for details.