https://github.com/sabrinapg/bingo-simulator
R Studio Project that simulates a BINGO game
https://github.com/sabrinapg/bingo-simulator
bingo-game csv-reader r rstudio
Last synced: 4 months ago
JSON representation
R Studio Project that simulates a BINGO game
- Host: GitHub
- URL: https://github.com/sabrinapg/bingo-simulator
- Owner: sabrinapg
- Created: 2024-08-08T14:22:43.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-08-08T14:36:54.000Z (about 1 year ago)
- Last Synced: 2025-03-20T18:25:24.565Z (7 months ago)
- Topics: bingo-game, csv-reader, r, rstudio
- Language: R
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# bingo-simulator
R Studio Project that simulates a BINGO gameThis project is a simulation of a Bingo game implemented in R. Each player is assigned a unique Bingo sheet, and numbers are drawn randomly until a player (or players) wins by marking all numbers in a row, column, or diagonal. The game continues until a winner is declared.
- CSV Input: Player data is read from a CSV file.
- Player Setup: Each player is assigned a unique Bingo sheet and a corresponding "hit" matrix to track their progress.
- Game Logic: Numbers are drawn randomly, and players' Bingo sheets are updated accordingly. The game checks for a winner after each draw.
- User Interaction: The game prompts the user to press Enter to continue to the next round until a winner is found.How It Works
1. Load Player Data: Reads player information from a CSV file and assigns each player a unique ID.
2. Generate Bingo Sheets: Each player receives a random 5x5 Bingo sheet with unique numbers.
3. Track Progress: A "hit" matrix is created for each player to track marked numbers.
4. Game Loop:
- A random number is drawn.
- Each player’s Bingo sheet is checked and updated if the number is on their sheet.
- The game checks for a Bingo (a complete row, column, or diagonal of marked numbers).
5. Declare Winner: Once a player wins, the game announces the winner(s) and ends.How to Run
1. Ensure you have a CSV file with player data, including first and last names.
2. Run the R script.
3. Follow the prompts to draw numbers and proceed through the game until a winner is declared.Notes
- The game continues until at least one player achieves Bingo.
- In case of multiple winners, the game will announce all winners.Dependencies
- R (no additional packages required)
License
This project is open-source and available under the MIT License.