Simple Blackjack Game
This was initially a module in Scrimba, but i enjoyed building it so much that eventually i tried taking it further to give it more semblance to an actual online blackjack game.
I used a number of concepts learned during the module, as well as some additional functions that i have added into my code.
- If/Else conditionals
- Boolean variables
- Arrays (indexes, multiple data types)
- For loops
- Math built-in functions
- Logical Operators
- Objects
- Switch statements
Honestly the most challenging part i faced in this was the Ace. An Ace will have a value of 11 unless that would give a player or the dealer a score in excess of 21; in which case, it has a value of 1. I used several logical operators to change the value of the hand if the player drew aces.
Still a work in progress however, i intend to further improve the game in the future commits in the following aspects:
- Implementation for player credits (ie, add winnings/deduct bets/numerical input and button to buy more credits)
- Dealer
- More options for player to fit Casino Blackjack rules (Stand/Hit/Split/Insurance, etc)