Closed gstark closed 6 years ago
Done with explorer https://github.com/mrected/blackjack blackjack-chris.surge.sh
As a good practice, setup your event listeners inside of the DOMContentLoaded
listener (in this case main
) -- this will avoid a dependency on the load order of your HTML and your JS
if (gamePlaying === false) {
can be if (!gamePlaying) {
21
is repeated a lot in the code. Consider a constant const BlackJack = 21
-- This is a common refactoring, Replace Magic Number
const getScore = cards => {
let tempScoreArray = []
cards.forEach(card => {
tempScoreArray.push(card.value)
})
return tempScoreArray.reduce((score, currentValue) => score + currentValue)
}
could be
const getScore = cards => {
return cards.map(card => card.value).reduce((score, currentValue) => score + currentValue)
}
Your homework was marked: Meets Expectations
“With LASERS” — via Jason L Perry
In this project you will create a playable game of Blackjack.
Objectives
Requirements
Create a single player black jack games that plays against the house, i.e. a human player and computer dealer. You are free to create the user interface however you want, but keep it simple for Explorer Mode.
General Rules:
Assets
images
folder in your projectcards.zip
file and then copy/move the extracted images into your project'simages
folderExplorer Mode
Adventure Mode
Epic Mode