-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
199 lines (174 loc) Β· 5.55 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
<!DOCTYPE html>
<meta charset="UTF-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"
/>
<head>
<title>ladder - single player card game</title>
<style>
h1 {
font-size: 12px;
font-style: italic;
}
body {
touch-action: manipulation;
zoom: 2;
user-select: none; /* supported by Chrome and Opera */
-webkit-user-select: none; /* Safari */
-khtml-user-select: none; /* Konqueror HTML */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* Internet Explorer/Edge */
}
a {
color: deeppink;
}
#skipSwitch {
display: inline;
}
#skipBlank {
display: inline;
}
</style>
<script type="text/javascript" src="play.js"></script>
</head>
<body>
<h1>Ladder</h1>
<div id="buttons">
<p id="skipBlank"></p>
<button onclick="getCards()" id="getButton">draw</button>
<p id="skipSwitch">
<button id="skipButton" onclick="skipCards()">skip(1)</button>
</p>
<button id="button2" onClick="window.location.reload();">π₯</button>
</div>
<p id="firstLine">βοΈ draw your first card! (restart: π₯)</p>
<p id="myHandinP"></p>
<table>
<tr>
<td>total score β¬ * β</td>
<td id="totalScoreInTd"></td>
</tr>
<tr>
<td>depth β¬</td>
<td id="verticalScoreInTd"></td>
</tr>
<tr>
<td>max length β</td>
<td id="MaxDistanceInTd"></td>
</tr>
<tr>
<td>current length β©</td>
<td id="DistanceInTd"></td>
</tr>
</table>
<br />
<div>
<a
href="https://docs.google.com/spreadsheets/d/1dmPNtIaByoqUWx6yoQMMsj1UwL6NEg4td-t-CWkNkGk/edit#gid=1505676368"
>100,000 times playing data</a
>
</div>
<div>
<p>some interesting numbers...</p>
<ul>
<li>max score was 81 (1/100000)</li>
<li>min score was 3 (3/100000)</li>
<li>max depth was 14 (1/100000)</li>
<li>max length was 12 (4/100000)</li>
<li>most common score was 12 (13361/100000)</li>
</ul>
<p>π game & code by <a href="https://hi.tago.so">Tago So</a></p>
</div>
<script>
// getButton
document.getElementById("getButton").addEventListener("click", function () {
document.getElementById("firstLine").innerHTML =
"your score is " + verticalScore * widthMax + "! restart: π₯";
});
document.getElementById("getButton").addEventListener("click", function () {
document.getElementById("verticalScoreInTd").innerHTML = verticalScore;
});
document.getElementById("getButton").addEventListener("click", function () {
document.getElementById("DistanceInTd").innerHTML = widthTemp;
});
document.getElementById("getButton").addEventListener("click", function () {
document.getElementById("MaxDistanceInTd").innerHTML = widthMax;
});
document.getElementById("getButton").addEventListener("click", function () {
document.getElementById("totalScoreInTd").innerHTML =
verticalScore * widthMax;
});
document.getElementById("getButton").addEventListener("click", function () {
if (skippable === false) {
document.getElementById("skipSwitch").innerHTML =
'<button id="skipButton" disabled>skip(0)</button>';
}
});
document.getElementById("getButton").addEventListener("click", function () {
document.getElementById("myHandinP").innerHTML = myHandHTML.join("");
if (drawDeck.length !== 0) {
document.getElementById("firstLine").innerHTML =
"remaining π : " +
(drawDeck.length - 1) +
"<br>" +
"your hand: " +
drawDeck[0].symbol +
drawDeck[0].number;
}
});
// skipCards
document
.getElementById("skipButton")
.addEventListener("click", function () {
document.getElementById("firstLine").innerHTML =
"your score is " + verticalScore * widthMax + "! restart: π₯";
});
document
.getElementById("skipButton")
.addEventListener("click", function () {
console.log("skipCards is working");
document.getElementById("verticalScoreInTd").innerHTML = verticalScore;
});
document
.getElementById("skipButton")
.addEventListener("click", function () {
document.getElementById("DistanceInTd").innerHTML = widthTemp;
});
document
.getElementById("skipButton")
.addEventListener("click", function () {
document.getElementById("MaxDistanceInTd").innerHTML = widthMax;
});
document
.getElementById("skipButton")
.addEventListener("click", function () {
document.getElementById("totalScoreInTd").innerHTML =
verticalScore * widthMax;
});
document
.getElementById("skipButton")
.addEventListener("click", function () {
console.log("html: " + skippable);
skippable = false;
if (skippable === false) {
document.getElementById("skipSwitch").innerHTML =
'<button id="skipButton" disabled>skip(0)</button>';
}
});
document
.getElementById("skipButton")
.addEventListener("click", function () {
document.getElementById("myHandinP").innerHTML = myHandHTML.join("");
if (drawDeck.length !== 0) {
document.getElementById("firstLine").innerHTML =
"remaining π : " +
(drawDeck.length - 1) +
"<br>" +
"your hand: " +
drawDeck[0].symbol +
drawDeck[0].number;
}
});
</script>
</body>