-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
301 lines (288 loc) · 19.7 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
<html ng-app="ngBlackJack">
<head>
<meta charset="UTF-8">
<title>RTST BlackJack</title>
<!-- CSS -->
<link rel="stylesheet" href="css/materialize/materialize.min.css">
<link rel="stylesheet" href="css/materialize/material-icons.css">
<link rel="stylesheet" href="css/white-line-button.css">
<link rel="stylesheet" href="css/manual-mode.css">
<link rel="stylesheet" href="css/animate.css">
<link rel="stylesheet" href="css/custom.css">
<link rel="stylesheet" href="css/cards.css">
<link rel="stylesheet" href="css/toastr.min.css">
<!-- JavaScript -->
<script src="js/jquery/jquery-2.2.4.min.js"></script>
<script src="js/materialize/materialize.min.js"></script>
<script src="js/angular-1.5.6/angular.min.js"></script>
<script src="js/toastr.min.js"></script>
<!-- JavaScript Custom -->
<script src="js/app.js"></script>
<script src="js/services/hand.js"></script>
<script src="js/services/card.js"></script>
<script src="js/services/deck.js"></script>
<script src="js/services/player.js"></script>
<script src="js/services/strategy-tables/noSurrender.js"></script>
<script src="js/services/strategy-tables/surrenderWithAce.js"></script>
<script src="js/services/strategy-tables/surrenderWithoutAce.js"></script>
</head>
<body ng-controller="ngGame">
<div class="container">
<div class="row" style="padding-top: 4%">
<div class="col l2 m2" ng-click="openRulesModal()">
<a class="custom-button outline" href="#">
Rules
<span class="lines"></span>
</a>
</div>
<div class="offset-l1 offset-m1 col l6 m6 center-align">
<span id="headline">Blackjack Strategies</span>
</div>
<div class="offset-l1 offset-m1 col l2 m2 right-align" ng-click="openTeamModal()">
<a class="custom-button outline" href="#">
Article
<span class="lines"></span>
</a>
</div>
</div>
</div>
<div id="background-image" class="container centered">
<div class="row"></div>
<div class="row">
<div class="col l3 m3 manual-mode-box">
<span class="manual-mode-text">Manual Mode: </span>
<label class="manual-switch">
<input type="checkbox" class="switch-input">
<span class="switch-label" data-on="On" data-off="Off" ng-click="toggleManualMode()"></span>
<span class="switch-handle"></span>
</label>
<a class='dropdown-button btn red darken-3' data-activates='gameMode' style="margin-top: 10px;">Game Mode</a>
<ul id='gameMode' class='dropdown-content'>
<li><a ng-click="toggleGameMode('noSurrender')">No Surrender<span class="badge game-mode-badge"><i id="badge1" class="material-icons"></i></span></a></li>
<li class="divider"></li>
<li><a ng-click="toggleGameMode('surrenderWithAce')">Surrender With Ace<span class="badge game-mode-badge"><i id="badge2" class="material-icons"></i></span></a></li>
<li class="divider"></li>
<li><a ng-click="toggleGameMode('surrenderWithoutAce')">Surrender Without Ace<span class="badge game-mode-badge"><i id="badge3" class="material-icons"></i></span></a></li>
</ul>
</div>
<div class="offset-l1 col l6 offset-m1 m6 cards-rows" style="padding-top: 10px;">
<div>
<div class="playing-card-parent-div animated fadeInRight" ng-repeat="(key, card) in dealer.hands[0].cards" style="animation-duration: {{key+2}}s;">
<div class="playing-card" ng-click="manualChooseCardForHiddenCard(card, 1)" ng-class="hideCardOrShow(card)"></div>
</div>
</div>
</div>
<div class="col l2 m2">
<div ng-show="dealFirstTimeForAdvice" class="advice advice-hover tooltipped" data-position="down" data-delay="100" data-tooltip={{getAdvice()}}>
<div class="animated fadeIn advice-fade" ng-class="{'fadeOut': !showAdvice}">
<a class="custom-button outline animated shake advice-shake">
<div>
<span>Advice</span>
</div>
<span class="lines"></span>
</a>
</div>
</div>
</div>
</div>
<div class="row"></div>
<div class="row center">
<div>
<a class="sum-boxes no-hover custom-button outline">
<span>Dealer Sum of Cards: {{dealer.hands[0].sum()}}</span>
<span class="lines"></span>
</a>
</div>
</div>
<div class="row">
<div class="col offset-l4 l7 offset-m4 m7 cards-rows">
<div ng-repeat="hand in player.hands">
<div class="playing-card-parent-div animated fadeInRight" ng-repeat="(key, card) in hand.cards" style="animation-duration: {{key+2}}s;">
<div class="playing-card" ng-click="manualChooseCardForHiddenCard(card, 2)" ng-class="hideCardOrShow(card)"></div>
</div>
</div>
</div>
</div>
<div class="row center">
<div>
<a class="sum-boxes no-hover custom-button outline">
<span>Player Sum of Cards: {{player.hands[0].sum()}}</span>
<span class="lines"></span>
</a>
</div>
</div>
<div>
<div class="row center animated pulse infinite deal" ng-hide="startGame">
<a class="waves-effet waves-light light-green darken-2 btn" ng-click="dealCards()">Deal</a>
</div>
<div class="row center animated pulse infinite deal" ng-hide="startGame">
<a class="waves-effet waves-light pink darken-3 btn" ng-click="openSimulateModal()" >Simulate Games</a>
</div>
<div class="row center" ng-show="startGame">
<div id="top-icons" class="animated flipInX">
<div class="start-game-buttons">
<a class="btn-floating btn-large waves-effect waves-light green darken-4" ng-click="hitCardForPlayer()"><i class="material-icons">add_circle</i></a>
<span class="start-game-text">Hit</span>
</div>
<div class="start-game-buttons">
<a class="btn-floating btn-large waves-effect waves-light teal darken-4" ng-click="stand()"><i class="material-icons">pan_tool</i></a>
<span class="start-game-text">Stand</span>
</div>
<div class="start-game-buttons">
<a class="btn-floating btn-large waves-effect waves-light blue darken-1" ng-click="double()"><i class="material-icons">exposure_plus_2</i></a>
<span class="start-game-text">Double</span>
</div>
<div class="start-game-buttons" ng-show="splitCards">
<a class="btn-floating btn-large waves-effect waves-light brown darken-4"><i class="material-icons">call_split</i></a>
<span class="start-game-text">Split</span>
</div>
</div>
<div id="bottom-icons" class="animated fadeIn">
<div class="start-game-buttons">
<a class="btn waves-effect waves-light red" ng-click="surrender()"><i class="material-icons">block</i></a>
<span class="start-game-text">Surrender</span>
</div>
</div>
</div>
</div>
</div>
<div class="wins-loses no-hover">
<a class="custom-button outline">
<div>
<span>Wins: {{player.wins}}</span>
</div>
<div>
<span>Loses: {{player.loses}}</span>
</div>
<div>
<span>Wins Ratio: {{getWinRatio()}}</span>
</div>
<span class="lines"></span>
</a>
</div>
<div class="visitors no-hover">
<a class="custom-button outline">
<div>
<span>Visitors</span>
</div>
<div>
<img src="http://hitwebcounter.com/counter/counter.php?page=6412631&style=0006&nbdigits=5&type=page&initCount=0" title="Free track counters" Alt="Free track counters" border="0" >
</div>
<span class="lines"></span>
</a>
</div>
<div id="custom-footer">
<div class="center-align">
<span>Stochastic Modelling, Course: 30029, 2016</span>
<img id="logo" src="img/logo.png">
</div>
</div>
<!-- Modal Structure -->
<div id="simulate" class="modal">
<div class="modal-content">
<h4>Automatic Games Simulation</h4>
<h5>Games will simulate automatically using the advices</h5>
<div class="center-align">
<p class="range-field" id="simulateCount">
<input type="range" min="1" max="1000" />
</p>
</div>
</div>
<div class="modal-footer">
<a class="modal-action modal-close waves-effect waves-green btn-flat" ng-click="simulateGames()">Simulate</a>
</div>
</div>
<div id="rules" class="modal">
<div class="modal-content">
<h4>BlackJack Rules</h4>
<p>
Dealer Hits Soft 17
<br><br>
Generally, the dealer in blackjack must hit if he has a total of 16 or less, and stand if he has 17 or more.
<br><br>
But at some games there is an exception when the dealer has a hand of “soft” 17.
<br><br>
If you look at the table, you will see one of two phrases on the felt:
<br><br>
Dealer Stands on All 17s: This is the simple version. The dealer will stand with any total of 17 or more, whether that total is
<br><br>
“soft” or not. (This rule is abbreviated S17. The S is for Stand, not Soft!)
<br><br>
Dealer Hits Soft 17: In casinos with this rule, the dealer will stand with any hard 17, but draw another card if he has a soft 17,
<br><br>
such as (Ace, 2, 4). (This rule is abbreviated H17.)
<br><br>
Seventeen is a weak hand, so if the dealer is allowed to try to improve the soft 17 hands, it makes the game tougher. When a dealer is
<br><br>
allowed to hit soft 17, it adds about 0.2% to the house advantage.
<br><br>
Years ago, the only “Hit Soft 17” games in the US were in and around Reno, Nevada. Almost all other areas used the better rule of standing
<br><br>
on all 17s. Over the years, more and more casinos have switched to hitting soft 17, and there are now far more H17 games than S17
<br><br>
games.
<br><br>
You can still find some games where the dealer stands on all 17s, even in casinos where some of the tables use
<br><br>
the H17 rule. Look around!
</p>
</div>
<div class="modal-footer">
<a class="modal-action modal-close waves-effect waves-green btn-flat ">Agree</a>
</div>
</div>
<div id="team" class="modal">
<div class="modal-content">
<h4>Blackjack: the concept of expected value</h4>
<p>
This article first appeared in the Nov/Dec 2010 issue of World Gaming magazine.
<br><br>
Our resident blackjack gurus explain EV, a fundamental gaming concept understood by all expert players.
<br><br>
In several of our prior articles we've mentioned the concept of expected value (EV), and said that we'd explain it more thoroughly in a later article. The time has come.
<br><br>
EV has lots of names: expectation, long-run expectation, LRE, fair value or expected value. Most people tend call it EV these days. EV isn't a concept unique to blackjack. You find it in poker, baccarat, craps and just about every casino (and some non-casino) games. You even find it in the imprecise world of professional sports betting. It is most useful in poker and blackjack – games where significant decisions need to be made mid-way through a hand. It's also useful in bet sizing for sports bets.
<br><br><br><br>
EV is best thought of as the "value right now" of something or making a particular decision. Let us give you an example. Let's say you place a bet on a Blackjack table for $1,000. As luck would have it you get dealt two picture cards for a total of 20, and the dealer has a 6 as his upcard. You're looking good! Of course you stand on your 20. What is this hand worth at this moment? If you suddenly had to sell this hand, before the dealer drew his cards, what would be the fair price? Of course you're not guaranteed to win $1,000, so the fair price has got to be less than $1,000, but how much less? $900? $800? Before you read on, think about it – would you sell the winnings of this hand to someone for a flat $800? Yes or no? Most people would answer no. 20 is a pretty good hand and the dealer only has a 6!
<br><br>
Obviously there are three possibilities here. The dealer could draw out to 21 and you unluckily lose, the dealer could draw out to 20 and you get a push (also known as a stand-off), or the dealer could get 19 or worse, and you win. I've run countless simulations and mathematical calculations on blackjack over more than 20 years, and I can tell you that when the dealer starts with a 6, he gets a 21 total 9.7% of the time, a 20 total 10.2% of the time, and 19 or worse the remaining 80.1% of the time. So back to our HK$1,000 bet. 80.1% of the time we win $1,000, 10.2% of the time we neither win nor lose, and 9.7% of the time we unluckily lose $1,000. The net result is that over very many hands, on average we win $704 for each time we get 20 against the dealer's 6 with a $1,000 bet out there. Another way of thinking of this is that the EV of this situation is +70.4%. So the fair price for this hand is $704 and if someone offered you $800 (plus the original $1,000 bet of course), then you should take the $1,800 and run! It's a $96 profit!
<br><br><br><br>
How is this number useful? Well, you can use it to calculate decisions. For example, some people like to split their tens when the dealer has a six. Many experienced players say they are crazy! Are they? Let's see. We've already established that standing on 20 against a 6 is worth +70.4%. What if we split? We'll have two hands of ten versus the dealer's 6. Calculating the value of that single ten card against the dealer's 6 is much more complicated than the example above, because you have to calculate the EVs of all the possible hands you could get when you hit the ten. It's far too complicated for this article, but trust us when we tell you we have crunched the numbers and it comes out that each ten, on its own, has an EV of +28.8%. Yes it's a positive number, but not so high really. Now remember if you split you will have two of these +28.8% tens, so which would you prefer? Two things worth +28.8 or one thing worth +70.4? Of course the one thing worth 70.4 is better, so it's better to stick with 20 than split the tens. Don't be greedy! (Or in fact, be greedy!) Actually it turns out that standing on 20 is better than splitting the tens against all ten possible dealer upcards (2, 3, 4, 5, 6, 7, 8, 9, 10 and Ace) so it's never correct to split tens (there is a very advanced exception to this rule but it doesn't really apply in Macau). So there you have it – those ten splitters are crazy after all.
<br><br>
You can use EV calculations like this to work out all sorts of blackjack decisions. For example, what about when you have 12 and the dealer has a 3? Some people say to stand and some people say to hit. Who is right? We can give you the answer, the people who say hit are right. Hitting the 12 has an EV of -23.3% and standing is -25.2%. Not much in it, and you expect to lose no matter what you do, but remember money saved is just as valuable as money won. Better to lose 23.3% than to lose 25.2%. I know this isn't much consolation when you hit the 12 and get a picture card and lose 100% of your bet! But it is a fact that in the long run you will be financially better off by hitting all your 12s against threes.
<br><br>
Now you understand the concept of EV better. It's a concept understood by all expert gamblers, no matter whether they are casino gamblers, sports bettors or poker players. You don't have to follow the decisions that EV tells you to make when you play, but I can assure you all the experts do.
</p>
</div>
<div class="modal-footer">
<a class="modal-action modal-close waves-effect waves-green btn-flat ">Close</a>
</div>
</div>
<div id="dealerChooseCard" class="modal bottom-sheet" style="background-color: #DFDFDF">
<div class="modal-content">
<h4>Choose card for dealer</h4>
<div class="row">
<div class="col l1 m1 manual-card-modal-div" ng-repeat="i in [1,2,3,4,5,6,7,8,9,10,11,12,13]">
<div class="playing-card-parent-div">
<div ng-click="manualChooseCardModal(i)" class="playing-card rank-{{i}} clubs animated slideInUp">
</div>
</div>
</div>
</div>
</div>
</div>
<div id="playerChooseCard" class="modal bottom-sheet" style="background-color: #DFDFDF">
<div class="modal-content">
<h4>Choose your card</h4>
<div class="row">
<div class="col l1 m1 manual-card-modal-div" ng-repeat="i in [1,2,3,4,5,6,7,8,9,10,11,12,13]">
<div class="playing-card-parent-div">
<div ng-click="manualChooseCardModal(i)" class="playing-card rank-{{i}} hearts animated slideInUp">
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>