This project is a web application that calculates the odds of drawing a specific hand from a deck of cards based on user-defined requirements.
- calculator.html: The main HTML file that contains the user interface.
- calculator.js: The JavaScript file that contains the logic for calculating the odds.
- calculator.css: The CSS file for styling the user interface.
- README.md: This file, which provides an overview of the project and instructions for usage.
- TODO.md: A file that lists the tasks and features to be implemented.
-
Open the Application:
- Open
calculator.htmlin a web browser.
- Open
-
Set Options:
- Select the deck size (52 cards or 54 cards with jokers).
- Enter the hand size (number of cards in the hand).
-
Add Requirements:
- Select the type of requirement (e.g., Same Rank, Same Suit, Same Color).
- Specify the number of cards that should meet the requirement.
- Optionally, specify a specific rank, suit, or color.
-
Calculate Odds:
- Click the "Calculate Odds" button to compute the probability of drawing a hand that meets the specified requirements.
- The result will be displayed in the "Result" section.
To calculate the odds of drawing a hand with two cards of the same rank from a standard 52-card deck:
- Set the deck size to 52 cards.
- Set the hand size to 5 cards.
- Add a requirement for 2 cards with the same rank.
- Click "Calculate Odds".
The result will be displayed as a percentage.
To modify the project, edit the HTML, JavaScript, and CSS files as needed. The main logic for calculating the odds is implemented in calculator.js.
This project is licensed under the MIT License.