Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
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
48 changes: 24 additions & 24 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
module.exports = {
env: {
browser: true,
es2020: true,
},
extends: [
'airbnb-base',
],
parserOptions: {
ecmaVersion: 11,
},
rules: {
// Don't enforce control flow closing curly brace needs to be
// on same line as next control flow opening statement
'brace-style': 'off',
// Disable linebreak style to prevent ESLint errors on Windows line endings
// https://eslint.org/docs/rules/linebreak-style
'linebreak-style': 'off',
// Allow console for students to debug
'no-console': 'off',
// Allow function param reassign for array or object elements or properties
'no-param-reassign': ['error', { props: false }],
},
};
module.exports = {
env: {
browser: true,
es2020: true,
},
extends: [
'airbnb-base',
],
parserOptions: {
ecmaVersion: 11,
},
rules: {
// Don't enforce control flow closing curly brace needs to be
// on same line as next control flow opening statement
'brace-style': 'off',
// Disable linebreak style to prevent ESLint errors on Windows line endings
// https://eslint.org/docs/rules/linebreak-style
'linebreak-style': 'off',
// Allow console for students to debug
'no-console': 'off',
// Allow function param reassign for array or object elements or properties
'no-param-reassign': ['error', { props: false }],
},
};
34 changes: 17 additions & 17 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
Please fill out the survey before submitting the pull request. Thanks!

🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀

How many hours did you spend on this assignment?

Please fill in one error and/or error message you received while working on this assignment.

What part of the assignment did you spend the most time on?

Comfort Level (1-5):

Completeness Level (1-5):

What did you think of this deliverable?

Is there anything in this code that you feel pleased about?
Please fill out the survey before submitting the pull request. Thanks!
🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀
How many hours did you spend on this assignment?
Please fill in one error and/or error message you received while working on this assignment.
What part of the assignment did you spend the most time on?
Comfort Level (1-5):
Completeness Level (1-5):
What did you think of this deliverable?
Is there anything in this code that you feel pleased about?
10 changes: 5 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# File that sometimes appears on MacOS
.DS_Store

# Dependency directories
node_modules/
# File that sometimes appears on MacOS
.DS_Store
# Dependency directories
node_modules/
28 changes: 14 additions & 14 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[javascript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"editor.minimap.enabled": false,
"editor.tabSize": 2,
"editor.wordWrap": "on",
"eslint.format.enable": true,
"eslint.lintTask.enable": true,
"eslint.migration.2_x": "off"
}
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[javascript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"editor.minimap.enabled": false,
"editor.tabSize": 2,
"editor.wordWrap": "on",
"eslint.format.enable": true,
"eslint.lintTask.enable": true,
"eslint.migration.2_x": "off"
}
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
# Rocket Academy Coding Bootcamp: Video Poker
# Rocket Academy Coding Bootcamp: Video Poker

Video Poker is single-player Poker where we try to optimise our score by getting the best possible hands. The gameplay is as follows.

1. The user starts with 100 points.
2. When they click the "Deal" button the computer deals a hand of 5 cards. The user can choose any number of their cards to replace with new, random cards.
3. After the user finishes replacing cards, the game assigns points based on the resulting hand.
Binary file added images/cards.zip
Binary file not shown.
Binary file added images/cards/10_of_clubs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/cards/10_of_diamonds.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/cards/10_of_hearts.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/cards/10_of_spades.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/cards/2_of_clubs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/cards/2_of_diamonds.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/cards/2_of_hearts.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/cards/2_of_spades.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/cards/3_of_clubs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/cards/3_of_diamonds.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/cards/3_of_hearts.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/cards/3_of_spades.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/cards/4_of_clubs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/cards/4_of_diamonds.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/cards/4_of_hearts.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/cards/4_of_spades.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/cards/5_of_clubs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/cards/5_of_diamonds.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/cards/5_of_hearts.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/cards/5_of_spades.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/cards/6_of_clubs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/cards/6_of_diamonds.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/cards/6_of_hearts.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/cards/6_of_spades.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/cards/7_of_clubs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/cards/7_of_diamonds.png
Binary file added images/cards/7_of_hearts.png
Binary file added images/cards/7_of_spades.png
Binary file added images/cards/8_of_clubs.png
Binary file added images/cards/8_of_diamonds.png
Binary file added images/cards/8_of_hearts.png
Binary file added images/cards/8_of_spades.png
Binary file added images/cards/9_of_clubs.png
Binary file added images/cards/9_of_diamonds.png
Binary file added images/cards/9_of_hearts.png
Binary file added images/cards/9_of_spades.png
Binary file added images/cards/ace_of_clubs.png
Binary file added images/cards/ace_of_diamonds.png
Binary file added images/cards/ace_of_hearts.png
Binary file added images/cards/ace_of_spades.png
Binary file added images/cards/back.png
Binary file added images/cards/jack_of_clubs.png
Binary file added images/cards/jack_of_diamonds.png
Binary file added images/cards/jack_of_hearts.png
Binary file added images/cards/jack_of_spades.png
Binary file added images/cards/king_of_clubs.png
Binary file added images/cards/king_of_diamonds.png
Binary file added images/cards/king_of_hearts.png
Binary file added images/cards/king_of_spades.png
Binary file added images/cards/queen_of_clubs.png
Binary file added images/cards/queen_of_diamonds.png
Binary file added images/cards/queen_of_hearts.png
Binary file added images/cards/queen_of_spades.png
Binary file added images/logo.png
203 changes: 203 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,203 @@
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]> <html class="no-js"> <!--<![endif]-->
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>Shaz's Video Poker Game!</title>
<meta name="description" content="" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
<link href="https://unpkg.com/nes.css/css/nes.css" rel="stylesheet" />
<link rel="stylesheet" href="styles.css" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap"
rel="stylesheet"
/>
</head>
<body>
<div id="video-poker-machine">
<div id="signboard">
<div class="nes-container is-rounded is-dark">
<img src="./images/logo.png" id="logo" />
<h1>Video Poker</h1>
</div>
</div>
<div>
<table class="nes-table is-bordered is-dark" id="score-table">
<thead>
<tr>
<th></th>
<th>1</th>
<th>2</th>
<th>3</th>
<th>4</th>
<th>5</th>
</tr>
</thead>
<tbody>
<tr>
<td>Royal Flush</td>
<td>250</td>
<td>500</td>
<td>750</td>
<td>1000</td>
<td>4000</td>
</tr>
<tr>
<td>Straight Flush</td>
<td>50</td>
<td>100</td>
<td>150</td>
<td>200</td>
<td>250</td>
</tr>
<tr>
<td>Four Of A Kind</td>
<td>25</td>
<td>50</td>
<td>75</td>
<td>100</td>
<td>125</td>
</tr>
<tr>
<td>Full House</td>
<td>9</td>
<td>18</td>
<td>27</td>
<td>36</td>
<td>45</td>
</tr>
<tr>
<td>Flush</td>
<td>6</td>
<td>12</td>
<td>18</td>
<td>24</td>
<td>30</td>
</tr>
<tr>
<td>Straight</td>
<td>4</td>
<td>8</td>
<td>12</td>
<td>16</td>
<td>20</td>
</tr>
<tr>
<td>Three Of A Kind</td>
<td>3</td>
<td>6</td>
<td>9</td>
<td>12</td>
<td>15</td>
</tr>
<tr>
<td>Two Pair</td>
<td>2</td>
<td>4</td>
<td>6</td>
<td>8</td>
<td>10</td>
</tr>
<!-- <tr>
<td>Jacks Or Better</td>
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
<td>5</td>
</tr> -->
</tbody>
</table>
</div>
<div class="nes-container is-rounded is-dark">
<div id="instructions">
Start by pressing <span class="nes-text is-warning">Bet 1</span> or
<span class="nes-text is-error">Bet 5</span> and pressing
<span class="nes-text is-primary">Deal</span> after.
</div>
<div id="cards" class="display-none">
<div id="card-0" class="card"></div>
<div id="card-1" class="card"></div>
<div id="card-2" class="card"></div>
<div id="card-3" class="card"></div>
<div id="card-4" class="card"></div>
</div>
<div id="probabilities" class="display-none">
<hr />
<p>
Total Combinations Available:
<span id="total-combinations">1,533,939</span>
</p>
<hr />
<p>Royal Flush: <span id="probability-royal-flush">0.00</span>%</p>
<p>
Straight Flush: <span id="probability-straight-flush">0.00</span>%
</p>
<p>
Four Of A Kind: <span id="probability-four-of-a-kind">0.00</span>%
</p>
<p>Full House: <span id="probability-full-house">0.00</span>%</p>
<p>Flush: <span id="probability-flush">0.00</span>%</p>
<p>Straight: <span id="probability-straight">0.00</span>%</p>
<p>
Three Of A Kind: <span id="probability-three-of-a-kind">0.00</span>%
</p>
<p>Two Pair: <span id="probability-two-pair">0.00</span>%</p>
<!-- <p>
Jack Or Better: <span id="probability-jack-or-better">0.00</span>%
</p> -->
</div>
</div>
<div id="buttons">
<div class="is-rounded is-dark flex space-evenly align-items-center">
<div>
<button type="button" class="nes-btn is-warning" id="bet-1">
Bet 1
</button>
<button type="button" class="nes-btn is-error" id="bet-5">
Bet 5
</button>
<button
type="button"
class="nes-btn is-disabled"
id="deal"
disabled
>
Deal
</button>
<button
type="button"
class="nes-btn is-disabled"
id="calculate-probability"
disabled
>
Calculate Probability
</button>
</div>
</div>
<div>
<div class="text-white">
<span>Bet: <span id="player-bet">0</span></span>
<span>/</span>
<span>Credits: <span id="player-credits">100</span></span>
</div>
</div>
</div>
</div>
<script src="./scripts/functionHelper.js" async defer></script>
<script src="./scripts/uiHelper.js" async defer></script>
<script src="./scripts/testHands.js" async defer></script>
<script src="./scripts/checkCombination.js" async defer></script>
<script src="./scripts/checkHand.js" async defer></script>
<script src="./scripts/main.js" async defer></script>
</body>
</html>
5 changes: 5 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading