Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes in README file #2

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 87 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,40 @@
# Blackjack Application
# Casino Application

## Introduction

### Overview

This project involves the development of a Blackjack game application using Python and the Tkinter library for the graphical user interface (GUI). The game provides an interactive and engaging way to play Blackjack, simulating a real casino environment where the user competes against the dealer. The application includes features such as placing bets, hitting, standing, doubling down, and splitting hands.
This project involves the development of a casino games application using Python and the Tkinter library for the graphical user interface (GUI). The game provides an interactive and engaging way to play Blackjack, Dice Game, and Limbo, simulating a real casino environment where the user competes against the dealer. The application includes features such as placing bets, hitting, standing, doubling down, and splitting hands in Blackjack, rolling dice in the Dice Game, and predicting outcomes in Limbo.

### Objectives

- To create a user-friendly and interactive Blackjack game.

- To implement the core functionalities of Blackjack, including dealing cards, calculating hand values, and managing bets.
- To develop the Dice Game, allowing users to roll dice and win based on the outcome.
- To create the Limbo game, where users predict outcomes and win based on their predictions.
- To provide a simple and intuitive GUI for a seamless gaming experience.

## Blackjack Game Overview
## Casino Games Overview
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add rehab facility service description logic of how it works simply here

Copy link
Author

@nvspranathi nvspranathi Feb 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure @Arjunmehta312. I totally missed the rehab services feature in the application. Also, This rehab services option only exists in the Blackjack game. Its about 2 popups that come up when the balance amount is about half the initial amount. It just takes one point to describe it in the overview section. Are you sure you want me to add this description only in overview section? Do you think this feature should be added into dice game and Limbo as well instead of resetting the amount to 1000 when the whole amount is over?


### What are Limbo, Dice game and Blackjack?

Limbo is a game where players predict a multiplier value, and the game generates a random multiplier. The player wins if the generated multiplier is higher than their predicted value. The payout is calculated based on the predicted multiplier and the actual multiplier.

Dice Game involves players placing bets on the outcome of a dice roll. Players choose a target number and predict whether the dice will roll over or under that number. The player wins if the outcome matches their prediction, and the bet amount is won or lost accordingly.

Blackjack, also known as 21, is one of the most popular casino card games worldwide. The goal is to have a hand value closer to 21 than the dealer’s without exceeding 21. Players are dealt two initial cards and can choose to receive additional cards (hit) or keep their current hand (stand). When the user has only half the initial amount, to warn users about losing all their money if they proceed further, an option is provided to stop gambling and shows rehabilitation resources.

### What is Blackjack?
### How to Play Limbo

Blackjack, also known as 21, is one of the most popular casino card games worldwide. The goal is to have a hand value closer to 21 than the dealer’s without exceeding 21. Players are dealt two initial cards and can choose to receive additional cards (hit) or keep their current hand (stand).
- **Placing Bets:** Players place their bets and predict a multiplier value.
- **Game Start:** The game generates a random multiplier.
- **Winning:** The player wins if the generated multiplier is higher than their predicted value. The payout is calculated based on the predicted multiplier and the actual multiplier.

### How to Play Dice Game

- **Placing Bets:** Players place their bets on the outcome of the dice roll.
- **Rolling Dice:** The player chooses a target number and chooses whether the dice 'Rolls Over' or 'Rolls Under' and click 'Roll Dice'.
- **Winning:** The player wins if the number obtained post rolling matches their bet prediction. The Bet amount is won by the player if he wins the bet else the player looses that amount.

### How to Play Blackjack

Expand All @@ -29,28 +47,80 @@ Blackjack, also known as 21, is one of the most popular casino card games worldw

- **Graphical User Interface (GUI):** Developed using Tkinter, providing an interactive interface for gameplay.
- **Bet Management:** Allows users to place bets and manage their balance.
- **Game Actions:** Implemented core game actions such as hit, stand, double down, and split.
- **Game State Management:** Automatically handles the game state, including shuffling the deck and resetting the game after each round.
- **Game Actions:** Implemented core game actions such as hit, stand, double down, and split for Blackjack; rolling dice for Dice Game; and predicting multipliers for Limbo.
- **Game State Management:** Automatically handles the game state, including shuffling the deck, rolling dice, generating multipliers, and resetting the game after each round.


## Implementation

### Libraries and Tools

- **Python:** Main programming language.
- **Tkinter:** Used for creating the GUI.
- **Random:** Used for shuffling the deck and dealing cards.
- **Random:** Used for shuffling the deck and dealing cards, rolling dice, and generating random multipliers in the Limbo game.

### Code Structure

The application code is organized into several key sections:
The application code is organized into several key sections for each game:

#### Limbo Game

1. **Imports and Initial Setup:** Import necessary libraries and initialize constants like the deck of cards and balance.
2. **Helper Functions:** Define functions for dealing cards and calculating hand values.
3. **BlackjackApp Class:** Main class encapsulating all game logic, including GUI elements, game actions, and state management.
4. **Main Execution:** Initialize and run the game application.
1. **Imports and Initial Setup:** Import necessary libraries and initialize constants like the multipliers, balance, and other game-specific variables.
2. **Helper Functions:** Define functions for generating multipliers.
3. **LimboGame Class:** Class encapsulating all Limbo game logic, including GUI elements, game actions, and state management.

#### Dice Game

1. **Imports and Initial Setup:** Import necessary libraries and initialize constants like the dice, balance, and other game-specific variables.
2. **Helper Functions:** Define functions for rolling.
3. **DiceGame Class:** Class encapsulating all Dice game logic, including GUI elements, game actions, and state management.

#### Blackjack Game

1. **Imports and Initial Setup:** Import necessary libraries and initialize constants like the deck of cards, balance, and other game-specific variables.
2. **Helper Functions:** Define functions for dealing cards, and calculating hand values.
3. **BlackjackApp Class:** Main class encapsulating all Blackjack game logic, including GUI elements, game actions, and state management.

### Detailed Code Explanation

### Limbo Game
**Imports and Initial Setup**

- Balance: Starting balance for the player, initially set to 1000.
- Bet Amount: the initial bet amount will be 10.
- Multiplier Value: Starting Multiplier value is set to 2.

**Helper Functions**

- Play Limbo: The play_limbo function handles the betting logic, calculates win probability, determines the game result, updates the balance, and displays the outcome.

**Limbo Class**

- Initialization: Initializes the Blackjack game window, setting up the initial state and creating the GUI components.
- Create Widgets: Sets up the GUI components, including labels, buttons, and entry fields for displaying game information and allowing user actions.
- Update Balance: Updates the balance label to reflect the current balance.

### Dice Game
**Imports and Initial Setup**

- Balance: Starting balance for the player, initially set to 1000.
- Target Number: The target number is set to 50 on a slider.
- Chosen Option: The "Roll under" option is chosen initially.

**Helper Functions**

- Calculate Win Amount: This function calculates the amount won based on the bet and the probability.

**Dice Game Class**

- Initialization: Initializes the Blackjack game window, setting up the initial state and creating the GUI components.
- Create Widgets: Sets up the GUI components, including labels, buttons, and entry fields for displaying game information and allowing user actions.
- Set Bet Options: Sets the chosen betting option and updates the result label with the selected option and target value.
- Roll Dice: Simulates a dice roll, updates the user's balance based on the bet and result, and displays the outcome.
- Update Balance: Updates the balance label to reflect the current balance.
- Go Back to Menu: Closes the current window and reopens the start window.

### Blackjack Game
**Imports and Initial Setup**

- Balance: Starting balance for the player, initially set to 1000.
Expand All @@ -64,7 +134,7 @@ The application code is organized into several key sections:

**BlackjackApp Class**

- Initialization: Initializes the main application window, setting up the initial state and creating the GUI components.
- Initialization: Initializes the Blackjack game window, setting up the initial state and creating the GUI components.
- Create Widgets: Sets up the GUI components, including labels, buttons, and entry fields for displaying game information and allowing user actions.
- Update Balance: Updates the balance label to reflect the current balance.
- Place Bet: Validates the bet amount and starts a new round if the bet is valid.
Expand All @@ -82,8 +152,8 @@ The application code is organized into several key sections:

## Main Execution

The main part of the application initializes the main application window and starts the Tkinter main loop.
The main part of the application initializes the main application window and starts the Tkinter main loop.

## Conclusion

This Python Blackjack game project successfully demonstrates the integration of game logic with a graphical user interface. The game is designed to provide a realistic and engaging Blackjack experience, with functionalities that mirror a real casino environment. The use of Python and Tkinter allows for a simple yet effective implementation, making the game both fun and educational for users interested in learning about game development and GUI design.
This Python casino games project successfully demonstrates the integration of game logic with a graphical user interface. The game is designed to provide a realistic and engaging casino games experience, with functionalities that mirror a real casino environment. The use of Python and Tkinter allows for a simple yet effective implementation, making the game both fun and educational for users interested in learning about game development and GUI design.