Simple BlackJack game, play against dealer.
Live demo here: ➡️ BlackJack
Written in vanilla JavaScript, HTML, CSS. The special thing about this project for me, is that: I wrote it on my own without reading any other BlackJack code or without watching the tutorial.
All the necessary rules have been added to the game and are operational. I implemented my own CSS animations for better visuals & feels.
Fisher–Yates shuffle algorithm: Due to the weakness of the JavaScript's built-in shuffling while sorting1, during development I found different shuffling algorithm that working much better, and that's the only part I've used code from the web. See, below.
for (let i = arr.length - 1; i > 0; i--) {
let j = Math.floor(Math.random() * (i + 1))
;[arr[i], arr[j]] = [arr[j], arr[i]]
}