-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcounting-cards.html
More file actions
44 lines (39 loc) · 838 Bytes
/
counting-cards.html
File metadata and controls
44 lines (39 loc) · 838 Bytes
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
<!DOCTYPE html>
<html lang="en-gb">
<head>
<title>Counting Cards</title>
</head>
<body>
<!-- //// Provide element for the resulting instructions //// -->
<h2 id="whattodo"></h2>
<script>
var count = 0;
function cc(card) {
//// If statment to check conditions and return the instructions ////
if(card >1 && card < 7)
{
console.log("Card was: " + card);
count++;
}
else if(card > 6 && card < 10)
{
console.log("Card was: " + card);
count = count;
}
else
{
console.log("Card was: " + card);
count--;
}
if(count > 0)
{
document.getElementById("whattodo").innerHtml=(count + " Bet");
}
else
document.getElementById("whattodo").innerHtml=(count + " Hold");
}
//// Call the function and pass arguments ////
cc('K'), cc(6), cc(7), cc(4), cc(2);
</script>
</body>
</html>