mrected / assignments

SDG Assignments
0 stars 0 forks source link

Week 02 - Day 3 - Blackjack #8

Closed gstark closed 6 years ago

gstark commented 6 years ago

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

Explorer Mode

Adventure Mode

Epic Mode

mrected commented 6 years ago

Done with explorer https://github.com/mrected/blackjack blackjack-chris.surge.sh

gstark commented 6 years ago

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)
}
gstark commented 6 years ago

Your homework was marked: Meets Expectations

With LASERS

“With LASERS” — via Jason L Perry