/blackjack-game

My first ever project using JavaScript.

Primary LanguageJavaScript

Blackjack Game

This game is essentially the mini form of Blackjack, which is the American version of a popular global banking game known as Twenty-One.

Screenshot

View Project

How to play?

General Rules:

  • There are three buttons namely - Hit, Stand, and Deal.
  • This game is to be played by one Human Player and the Bot Player.
  • Hit button is used to initiate the Human Player's (Player 1) chance and Stand button is used to initiate the Bot Player's (Player 2) chance.
  • Player 1 is required to click the Hit button in order to generate one new card. Two clicks will generate two cards, three clicks will generate three and so on. Whereas, the Stand button is required to be clicked only once by Player 1 and then rest is taken care by Player 2.
  • After all the turns are over, the Deal button is required to be clicked by Player 1 in order to start the next game.

Who wins?

  • The player who exceeds 21 points gets busted. If one player gets busted, then the other wins. If both get busted, then it's a draw!
  • If Player 1 is below 21 points and has more points than Player 2, then Player 1 wins, and vice-e-versa.
  • There is a table to keep the record of 'Wins' and 'Losses' from the Human Player's point of view. E.g.- Wins: 2; Losses: 1; Draws: 4 -> It would denote that Human Player has won 2 games, lost 1 game, and 4 games ended up in a draw.

Built with:

Credits

Thanks to Rafeh Qazi for motivating me and the much needed inspiration!