Skip to content

Abhisheksingh734/BlackJack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Blackjack Game

This is a simple web-based Blackjack game built with HTML, CSS, and JavaScript. It allows players to compete against the dealer in an interactive and visually appealing interface. The goal is to achieve a hand value as close to 21 as possible without exceeding it, while beating the dealer's hand.


Features

  • Interactive Gameplay: Players can choose to "Hit" or "Stand" to improve their hand.
  • Dealer Mechanics: The dealer follows standard Blackjack rules for decision-making.
  • Responsive Design: Optimized for both desktop and mobile devices.
  • Smooth Animations: Cards are dealt with animations to enhance the gaming experience.

Technologies Used

  • HTML: Provides the structure and content for the game interface.
  • CSS: Adds styling, animations, and layout design.
  • JavaScript: Implements game logic, card handling, and user interaction.

How to Play

  1. Deal: The game begins with both you and the dealer receiving two cards.
  2. Hit or Stand: You can choose to:
    • Hit: Draw another card to improve your hand.
    • Stand: Stop drawing cards and end your turn.
  3. Dealer's Turn: The dealer automatically draws cards until their hand value is at least 17.

Winning Conditions

  • If your hand value exceeds 21, you lose.
  • If the dealer's hand value exceeds 21, you win.
  • If your hand value is closer to 21 than the dealer's without exceeding 21, you win.
  • If both hands are equal, it's a tie.

Setup Instructions

  1. Clone the repository to your local machine:
    git clone https://github.com/your-username/blackjack-game.git
  2. Open the index.html file in your web browser to start playing.

Project Structure

blackjack-game/
│
├── index.html           # Main HTML file
├── styles.css           # Styles for the game
├── script.js            # JavaScript logic for the game
└── README.md            # Project documentation

Game Design

  • User Interface: Displays cards for both the player and the dealer, with interactive buttons like 'Hit' and 'Stand'.
  • Animations: Smooth card-dealing animations enhance user engagement.
  • Responsive Layout: The game adapts seamlessly to various screen sizes.

Contributing

If you want to contribute to this project:

  1. Fork the repository.
  2. Create a new branch for your changes.
  3. Commit your changes and push them to your fork.
  4. Open a pull request.

License

This project is open-source and available under the MIT License.


Enjoy playing Blackjack!