Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
I
ICT100_Tutorials_T3_2022
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jonathan Vitale
ICT100_Tutorials_T3_2022
Commits
eb7ba0cd
Commit
eb7ba0cd
authored
2 years ago
by
Jonathan Vitale
Browse files
Options
Downloads
Patches
Plain Diff
Add game files and first skeleton
parents
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
game-logic.js
+33
-0
33 additions, 0 deletions
game-logic.js
index.html
+11
-0
11 additions, 0 deletions
index.html
with
44 additions
and
0 deletions
game-logic.js
0 → 100644
+
33
−
0
View file @
eb7ba0cd
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
This diff is collapsed.
Click to expand it.
index.html
0 → 100644
+
11
−
0
View file @
eb7ba0cd
<!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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment