Skip to content
Snippets Groups Projects
Commit eb7ba0cd authored by Jonathan Vitale's avatar Jonathan Vitale
Browse files

Add game files and first skeleton

parents
Branches
Tags tutorial-1
No related merge requests found
function blackjack(){
// decide the bet, collect it
// we deal the first 2 cards for the player
// check immediately that the player has blackjack
// if so, we need to pay 2.5 the bet -> end the game
// we deal the first 2 cards for the dealer
// one is hidden
// REPEAT THIS ------
// player makes a choice: hit or stand
// if player hits:
// we deal a new card to the player
// compute the new score
// if new score > 21 player loses -> end the game
// --- UNTIL THE PLAYER stands
// show the hidden card of the dealer
// REPEAT THIS -----
// If dealer has less than 17
// dealer draws a card
// if new score > 21 dealer loses ->
// need to pay the player 2 times the bet
// -> end the game
// --- UNTIL THE DEALER has 17 or more
// we need to compare player's score with dealer's score
// if player's score > dealer's score: player wins
// -> pay 2 times the bet
// end the game
}
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="game-logic.js"></script>
<title>Blackjack</title>
</head>
<body>
This is blackjack
</body>
</html>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment