Skip to content

Commit

Permalink
Added player object
Browse files Browse the repository at this point in the history
  • Loading branch information
Tshidycodes committed Apr 7, 2024
1 parent 08240fa commit 45c7edb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ <h1>BlackJack</h1>
<p id="sum-el">Sum:</p>
<button id="start-btn">START GAME</button>
<button id="new-btn">NEW CARD</button>
<p id="player-el"></p>
<script src="index.js"></script>
</body>
</html>
7 changes: 7 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ let startBtn = document.querySelector("#start-btn");
let sumEl = document.querySelector("#sum-el");
let cardsEl = document.querySelector("#cards-el");

let player = {
name: "Tshidi",
chips: 145,
};
let playerEl = document.querySelector("#player-el");
playerEl.textContent = `${player.name} : $${player.chips}`;

function getRandomCard() {
let randomNumber = Math.floor(Math.random() * 13) + 1;
if (randomNumber === 1) {
Expand Down

0 comments on commit 45c7edb

Please sign in to comment.