Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions app.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@

// there are a lot of global variables and not a lot of comments !
// well done, blackjack is a pretty complicated game and you handled it very well here
// definitely add more comments, and watch your indentation!
const deckUrl = "https://deckofcardsapi.com/api/deck/new/draw/?count=52"
let startButton = document.getElementById('fetch-click')
let playerBet = document.getElementById('player-button')
Expand Down Expand Up @@ -30,7 +33,7 @@ playerImgs = document.getElementById('player-imgs')
dealerImgs = document.getElementById('dealer-imgs')
let betButton = document.getElementById('place-bet')


// nice use of async and await !
async function getJson(url) {
let response = await fetch(url);
let data = await response.json()
Expand All @@ -40,7 +43,7 @@ async function getJson(url) {




// lots of white space and no comments
async function main(){
data = await getJson(deckUrl)
deck = data.cards
Expand Down
6 changes: 3 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ <h5>
<button id="continue" class="blink">click to continue</button>
</dialog>


<!-- watch indentation -->
<h1 id="msg"></h1>


<!-- when is this div supposed to get closed ? ( we missed it i think) -->
<div id="player">
<h5>player</h5>
<h3 id="player-count"></h3>
Expand All @@ -43,7 +43,7 @@ <h3 id="player-count"></h3>

<div id="bet">
<button id="place-bet">start</button>

<!-- be careful of our indentation ! got messed up here -->
<div>
<div id="scores">
<span>
Expand Down