akaaafk commited on
Commit
e5f5d1d
·
verified ·
1 Parent(s): 5f7a57a

Add files using upload-large-folder tool

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +2 -0
  2. benchmark/IEO/pdfs/AR_2026.pdf +3 -0
  3. benchmark/IOAI/IOAI-2025/At-Home-Round/Radar/validation_set/364.mat.pt +3 -0
  4. benchmark/IOAI/IOAI-2025/At-Home-Round/Radar/validation_set/365.mat.pt +3 -0
  5. benchmark/IOAI/IOAI-2025/At-Home-Round/Radar/validation_set/367.mat.pt +3 -0
  6. benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_endgame.html/checkanswer.js +281 -0
  7. benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_endgame.html/endgame.html +44 -0
  8. benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_endgame.html/endgame_solution.html +63 -0
  9. benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_endgame.html/index.html +111 -0
  10. benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1/Puzzle.html +70 -0
  11. benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1/Solution.html +59 -0
  12. benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1/asset_index.html +111 -0
  13. benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1/checkanswer.js +281 -0
  14. benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1/hint1.txt +9 -0
  15. benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1/index.html +42 -0
  16. benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1/solution1.txt +15 -0
  17. benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1/survey.txt +40 -0
  18. benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1_10_Puzzle.html/Puzzle.html +50 -0
  19. benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1_10_Puzzle.html/checkanswer.js +281 -0
  20. benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1_10_Puzzle.html/index.html +42 -0
  21. benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1_11_Puzzle.html/Puzzle.html +108 -0
  22. benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1_11_Puzzle.html/checkanswer.js +281 -0
  23. benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1_11_Puzzle.html/index.html +42 -0
  24. benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1_1_Puzzle.html/Puzzle.html +85 -0
  25. benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1_1_Puzzle.html/checkanswer.js +281 -0
  26. benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1_1_Puzzle.html/index.html +42 -0
  27. benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1_2_Puzzle.html/Puzzle.html +72 -0
  28. benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1_2_Puzzle.html/checkanswer.js +281 -0
  29. benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1_2_Puzzle.html/index.html +42 -0
  30. benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1_3_Puzzle.html/Puzzle.html +75 -0
  31. benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1_3_Puzzle.html/checkanswer.js +281 -0
  32. benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1_3_Puzzle.html/index.html +42 -0
  33. benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1_4_Puzzle.html/Puzzle.html +42 -0
  34. benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1_4_Puzzle.html/checkanswer.js +281 -0
  35. benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1_4_Puzzle.html/index.html +42 -0
  36. benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1_5_Puzzle.html/Puzzle.html +120 -0
  37. benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1_5_Puzzle.html/checkanswer.js +281 -0
  38. benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1_5_Puzzle.html/index.html +42 -0
  39. benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1_6_Puzzle.html/Puzzle.html +48 -0
  40. benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1_6_Puzzle.html/checkanswer.js +281 -0
  41. benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1_6_Puzzle.html/index.html +42 -0
  42. benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1_7_Puzzle.html/Puzzle.html +74 -0
  43. benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1_7_Puzzle.html/checkanswer.js +281 -0
  44. benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1_7_Puzzle.html/index.html +42 -0
  45. benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1_8_Puzzle.html/Puzzle.html +429 -0
  46. benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1_8_Puzzle.html/checkanswer.js +281 -0
  47. benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1_8_Puzzle.html/index.html +42 -0
  48. benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1_9_Puzzle.html/Puzzle.html +70 -0
  49. benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1_9_Puzzle.html/checkanswer.js +281 -0
  50. benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1_9_Puzzle.html/index.html +42 -0
.gitattributes CHANGED
@@ -805,3 +805,5 @@ benchmark/science_bowl/MS-Sample-Questions/Sample-Set-7/MS_Round-1.pdf filter=lf
805
  benchmark/science_bowl/MS-Sample-Questions/Sample-Set-6/Round8.pdf filter=lfs diff=lfs merge=lfs -text
806
  benchmark/science_bowl/MS-Sample-Questions/Sample-Set-7/MS_Round-13.pdf filter=lfs diff=lfs merge=lfs -text
807
  benchmark/science_bowl/MS-Sample-Questions/Sample-Set-7/MS_Round-11.pdf filter=lfs diff=lfs merge=lfs -text
 
 
 
805
  benchmark/science_bowl/MS-Sample-Questions/Sample-Set-6/Round8.pdf filter=lfs diff=lfs merge=lfs -text
806
  benchmark/science_bowl/MS-Sample-Questions/Sample-Set-7/MS_Round-13.pdf filter=lfs diff=lfs merge=lfs -text
807
  benchmark/science_bowl/MS-Sample-Questions/Sample-Set-7/MS_Round-11.pdf filter=lfs diff=lfs merge=lfs -text
808
+ benchmark/IEO/pdfs/AR_2026.pdf filter=lfs diff=lfs merge=lfs -text
809
+ benchmark/NYU_CTF_Bench/test/2022/CSAW-Quals/rev/AnyaGacha/src/client/Library/Artifacts/07/07a25769e4683136426e383407b29b29 filter=lfs diff=lfs merge=lfs -text
benchmark/IEO/pdfs/AR_2026.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ad1668c8a46525308185e0341c1558bc4325628b92520611c2ebadb3569b00b0
3
+ size 526881
benchmark/IOAI/IOAI-2025/At-Home-Round/Radar/validation_set/364.mat.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8884b5e76a4d58e37ceafd766111af0756edfda407b0483477159a74ebbd82e8
3
+ size 507932
benchmark/IOAI/IOAI-2025/At-Home-Round/Radar/validation_set/365.mat.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:43264f777eef40a97f712b604ec95cf96b3de25a3f1a6d9290efb31033c2ae4a
3
+ size 507937
benchmark/IOAI/IOAI-2025/At-Home-Round/Radar/validation_set/367.mat.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2c528bcd3b8e2edd1b9fd076fe5065da02e1e1955fe463e3f4d69dcb0fb3ce78
3
+ size 507932
benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_endgame.html/checkanswer.js ADDED
@@ -0,0 +1,281 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Do this first so that layout shift isn't too bad:
2
+ const container = document.createElement("div");
3
+ container.style = `
4
+ font-size: 16px;
5
+ font-size: clamp(16px, 2.4vw, 21px);
6
+ height: 2.5em;
7
+ `;
8
+ document.body.prepend(container);
9
+
10
+ import { React, html, css, render } from "./package.js";
11
+
12
+ /**
13
+ * Remove non-alphanumeric characters.
14
+ */
15
+ const normalizeAnswer = (answer) => {
16
+ if (getYear() === 2003) {
17
+ if (document.URL.includes("teamGuest/2")) {
18
+ // Special case: 2003 R2, whose answers are emoji.
19
+ return answer.trim();
20
+ } else if (document.URL.includes("6_3")) {
21
+ // Special case: Answer is literal Greek letter.
22
+ return answer.trim();
23
+ }
24
+ }
25
+ return answer.toUpperCase().replaceAll(/[^A-Z0-9]/g, "");
26
+ };
27
+
28
+ /**
29
+ * Returns the year of the hunt we're in.
30
+ */
31
+ const getYear = () => {
32
+ return Number(RegExp(`^.*/([0-9]{4})/.*$`).exec(document.URL)?.[1] ?? 0);
33
+ };
34
+
35
+ /**
36
+ * Fetches the answers as a list of {url, answer, prompt, intermediate}.
37
+ */
38
+ const getData = async () => {
39
+ const res = await fetch("/answers.tsv");
40
+ const data = await res.text();
41
+ const [header, ...body] = data.split("\n");
42
+ const headers = header.trim().split("\t");
43
+ return body.map((row) => {
44
+ const res = {};
45
+ row.split("\t").forEach((item, i) => {
46
+ res[headers[i]] = item.trim();
47
+ });
48
+ return res;
49
+ });
50
+ };
51
+
52
+ /**
53
+ * Gets the base URL; removes trailing index.html and .html, removes everything
54
+ * before the year, and then removes trailing slash.
55
+ */
56
+ const getBase = (url) => {
57
+ const root =
58
+ RegExp(`^(.*/)index.html`).exec(url)?.[1] ??
59
+ RegExp(`^(.*).html`).exec(url)?.[1] ??
60
+ url;
61
+ const base = RegExp(`^.*/([0-9]{4}/.*)$`).exec(root)?.[1] ?? root;
62
+ return base.endsWith("/") ? base.slice(0, -1) : base;
63
+ };
64
+
65
+ /**
66
+ * Get all rows in the data corresponding to a given URL. Group by same prompt.
67
+ */
68
+ const getAnswers = (data, url) => {
69
+ const base = getBase(url);
70
+ const rows = data.filter((row) => getBase(row.url) === base);
71
+ const prompts = [];
72
+ for (const row of rows) {
73
+ const { prompt } = row;
74
+ const group = prompts.find((group) => group.prompt === prompt);
75
+ if (group) {
76
+ group.rows.push(row);
77
+ } else {
78
+ prompts.push({ prompt, rows: [row] });
79
+ }
80
+ }
81
+ return prompts;
82
+ };
83
+
84
+ /**
85
+ * A single textbox and submit button in the rows of possible responses.
86
+ */
87
+ const ResponseRow = ({ prompt, rows, setFeedback }) => {
88
+ const [response, setResponse] = React.useState("");
89
+
90
+ const form = css`
91
+ align-items: baseline;
92
+ display: flex;
93
+ justify-content: right;
94
+ margin-bottom: 0.5em;
95
+
96
+ @media (max-width: 600px) {
97
+ align-items: flex-start;
98
+ flex-direction: column;
99
+ }
100
+ `;
101
+
102
+ const input = css`
103
+ background: #fafafa;
104
+ border: 1px solid #aaa;
105
+ border-radius: 2px;
106
+ color: #121212;
107
+ font-family: inherit;
108
+ font-size: 100%;
109
+ line-height: 1.2;
110
+ margin: 0 0.5em;
111
+ padding: 0.25em 0.5em;
112
+
113
+ @media (max-width: 600px) {
114
+ margin: 0 0 0.25em;
115
+ }
116
+ `;
117
+
118
+ const onSubmit = (e) => {
119
+ e.preventDefault();
120
+ let set = false;
121
+ for (const row of rows) {
122
+ const correct = normalizeAnswer(row.answer) === normalizeAnswer(response);
123
+ if (correct) {
124
+ setFeedback(
125
+ row.intermediate?.trim() === "TRUE"
126
+ ? "Correct! See the solution page for the answer."
127
+ : `Solved! The answer was ${row.answer}.`
128
+ );
129
+ set = true;
130
+ break;
131
+ }
132
+ }
133
+ if (!set) {
134
+ setFeedback("Incorrect.");
135
+ }
136
+ };
137
+
138
+ const onChange = (e) => setResponse(e.target.value);
139
+
140
+ return html`
141
+ <form class=${form} onSubmit=${onSubmit}>
142
+ <label htmlFor=${prompt + " prompt"}>
143
+ ${prompt || "Enter your guess"}:
144
+ </label>
145
+ <input
146
+ class=${input}
147
+ id=${prompt + " prompt"}
148
+ onChange=${onChange}
149
+ required
150
+ type="text"
151
+ value=${response}
152
+ />
153
+ <button type="submit">Submit</button>
154
+ </form>
155
+ `;
156
+ };
157
+
158
+ /**
159
+ * Check answer button, rendered at top of page.
160
+ */
161
+ const CheckButton = ({ prompts }) => {
162
+ const [open, setOpen] = React.useState(false);
163
+ const [feedback, setFeedback] = React.useState("Call in an answer.");
164
+
165
+ const wrapper = css`
166
+ font-family: "PT Sans", sans-serif;
167
+ font-size: 16px;
168
+ font-size: clamp(16px, 2.4vw, 21px);
169
+ height: 2.5em;
170
+
171
+ button {
172
+ background: #555;
173
+ border: none;
174
+ border-radius: 2px;
175
+ color: #fff;
176
+ cursor: pointer;
177
+ display: inline-block;
178
+ font-size: 1em;
179
+ font-family: "PT Sans", sans-serif;
180
+ font-weight: bold;
181
+ line-height: 1.2;
182
+ padding: 0.25em 1em;
183
+ text-align: center;
184
+ text-decoration: none;
185
+ text-transform: none;
186
+ }
187
+
188
+ p {
189
+ margin: 0 0 1em;
190
+ }
191
+
192
+ a {
193
+ color: inherit !important;
194
+ }
195
+ `;
196
+
197
+ const btnTop = [2015, 2016].includes(getYear())
198
+ ? "50px"
199
+ : [2012].includes(getYear())
200
+ ? "-2.5em"
201
+ : "0px";
202
+
203
+ const button = css`
204
+ box-sizing: border-box;
205
+ height: 2.5em;
206
+ left: 0;
207
+ position: absolute;
208
+ top: ${btnTop};
209
+ width: 100%;
210
+ z-index: 9999;
211
+ `;
212
+
213
+ const dropdownWrapper = css`
214
+ background: #edeff0;
215
+ color: #121212;
216
+ left: 0;
217
+ position: absolute;
218
+ right: 0;
219
+ top: calc(2.5em + ${btnTop});
220
+ z-index: 9999;
221
+ `;
222
+
223
+ const dropdown = css`
224
+ margin: 0 auto;
225
+ max-width: 40em;
226
+ padding: 1em;
227
+ z-index: 9999;
228
+ `;
229
+
230
+ const responses = css`
231
+ margin: 0 auto;
232
+ width: fit-content;
233
+
234
+ @media (max-width: 600px) {
235
+ width: auto;
236
+ }
237
+ `;
238
+
239
+ const onClick = () => setOpen(!open);
240
+
241
+ const body =
242
+ prompts.length > 0
243
+ ? prompts.map(
244
+ (group) =>
245
+ html`<${ResponseRow} setFeedback=${setFeedback} ...${group} />`
246
+ )
247
+ : html`<p>
248
+ No answers found on this page. Please report this to${" "}
249
+ <a href="mailto:puzzle@mit.edu">puzzle@mit.edu</a>.
250
+ </p>`;
251
+
252
+ return html`
253
+ <style>
254
+ @import url("https://fonts.googleapis.com/css2?family=PT+Sans:wght@400;700&display=swap");
255
+
256
+ ${[2015, 2016].includes(getYear()) &&
257
+ ".navbar-fixed-top { z-index: 10000 }"}
258
+ ${[2012].includes(getYear()) &&
259
+ "body { top: 2.5em } #check-answer, #shortcuts { z-index: 10000 !important }"}
260
+ ${[2006].includes(getYear()) && 'img[alt="Check Answer"] { display: none }'}
261
+ </style>
262
+ <div class=${wrapper}>
263
+ <button class=${button} onClick=${onClick}>
264
+ Check your answers spoiler-free
265
+ </button>
266
+ ${open &&
267
+ html`
268
+ <div class=${dropdownWrapper}>
269
+ <div class=${dropdown}>
270
+ <p>${feedback}</p>
271
+ <div class=${responses}>${body}</div>
272
+ </div>
273
+ </div>
274
+ `}
275
+ </div>
276
+ `;
277
+ };
278
+
279
+ const data = await getData();
280
+ const prompts = getAnswers(data, document.URL);
281
+ render(html`<${CheckButton} prompts=${prompts} />`, container);
benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_endgame.html/endgame.html ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <HTML>
2
+ <HEAD>
3
+ <TITLE>Mystery Hunt 2000</TITLE>
4
+ <LINK REV=owns HREF="mailto:puzzle@mit.edu">
5
+ </HEAD>
6
+
7
+ <BODY TEXT="#303030" BGCOLOR="#FFFFFF" LINK="#330066" ALINK="#000000"
8
+ VLINK="#000000">
9
+
10
+
11
+
12
+ <table width=100% border=0>
13
+ <tr><td align=left valign=top><h2>
14
+
15
+ <H3>Endgame</H3>
16
+
17
+ </h2></td>
18
+ <a href="index.html">Back to hunt</a>
19
+ </td></tr></table>
20
+
21
+ <blockquote><i>
22
+ After solving all of the metapuzzles, a team would receive the
23
+ endgame puzzle:
24
+ </blockquote></i>
25
+
26
+ <PRE>
27
+ In the following code, each letter stands for a digit, and each three
28
+ digit number represents a letter from one of the puzzle solutions from
29
+ earlier in the hunt. For example, 352 would be the 2nd letter of
30
+ Puzzle 3.5. Good luck... your goal may be just around the corner...
31
+
32
+ ARA ULT TAR ETA RLS AMU TUR ESS
33
+ UEA RMT UAU ALA
34
+ TSA UUU ELM UMU
35
+ RRR TTT AAA EEE
36
+ TEA UTE ERT TRR ABM AER RSR
37
+ ASU REE TBM USR EAB TMA RTU EUT
38
+ </PRE>
39
+
40
+ <A HREF="endgame_solution.html">Endgame Solution</A>
41
+
42
+ </BODY>
43
+ <script type="module" src="/checkanswer.js"></script>
44
+ </HTML>
benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_endgame.html/endgame_solution.html ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <HTML>
2
+ <HEAD>
3
+ <TITLE>Mystery Hunt 2000</TITLE>
4
+ <LINK REV=owns HREF="mailto:puzzle@mit.edu">
5
+ </HEAD>
6
+
7
+ <BODY TEXT="#303030" BGCOLOR="#FFFFFF" LINK="#330066" ALINK="#000000"
8
+ VLINK="#000000">
9
+
10
+
11
+
12
+ <table width=100% border=0>
13
+ <tr><td align=left valign=top><h2>
14
+
15
+ <H3>Endgame (Solution)</H3>
16
+
17
+ </h2></td>
18
+ <a href="index.html">Back to hunt</a>
19
+ </td></tr></table>
20
+
21
+ <PRE>
22
+ Author: Dan Katz
23
+
24
+ ARA ULT TAR ETA RLS AMU TUR ESS
25
+ UEA RMT UAU ALA
26
+ TSA UUU ELM UMU
27
+ RRR TTT AAA EEE
28
+ TEA UTE ERT TRR ABM AER RSR
29
+ ASU REE TBM USR EAB TMA RTU EUT
30
+
31
+ A=1
32
+ T=2
33
+ U=3
34
+ E=4
35
+ R=5
36
+ M=6
37
+ S=7
38
+ L=8
39
+ B=9
40
+
41
+ A P P R O A C H
42
+ 151 328 215 421 587 163 235 477
43
+
44
+ R O O M
45
+ 341 562 313 181
46
+
47
+ B A U M
48
+ 271 333 486 363
49
+
50
+ C O I N
51
+ 555 222 111 444
52
+
53
+ B E N E A T H
54
+ 241 324 452 255 196 145 575
55
+
56
+ G R E E N E R Y
57
+ 173 544 296 375 419 261 523 432
58
+
59
+ Iterating the cipher once more, BAUM = 9-136
60
+ </PRE>
61
+
62
+ </BODY>
63
+ </HTML>
benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_endgame.html/index.html ADDED
@@ -0,0 +1,111 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <title>2000 Mystery Hunt · MIT Mystery Hunt / Puzzle Club</title>
6
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
7
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
8
+ <link
9
+ href="https://fonts.googleapis.com/css2?family=PT+Serif:ital,wght@0,400;0,700;1,400&family=Syncopate:wght@700&display=swap"
10
+ rel="stylesheet"
11
+ />
12
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
13
+ <link rel="stylesheet" href="/style.css" type="text/css" />
14
+ <meta
15
+ name="description"
16
+ content="The MIT Mystery Hunt is an internationally renowned puzzle competition which takes place every January on MIT campus and attracts hundreds of participants from all over the world."
17
+ />
18
+ <meta property="og:image" content="/images/header-coin.png" />
19
+ <meta
20
+ property="og:description"
21
+ content="The MIT Mystery Hunt is an internationally renowned puzzle competition which takes place every January on MIT campus and attracts hundreds of participants from all over the world."
22
+ />
23
+ </head>
24
+ <body>
25
+ <div id="header"></div>
26
+ <main id="main">
27
+
28
+ <h1><a href="../huntsbyyear.html">Archives</a> / 2000 Mystery Hunt </h1>
29
+
30
+ <h3>Description</h3>
31
+ <p> The 2000 Mystery Hunt was based on <em>Wizard of Oz</em> and asked teams to help guide Dorothy back
32
+ home using the Tornado-Operated Object Levitator (T.O.O.L.), which required a coin for its operation.</p>
33
+ <p> The coin was found at 2:18am on Sunday by Paintttniap, in a planter outside 9-136.</p>
34
+
35
+ <h3>Credits</h3>
36
+ The 2000 Mystery Hunt was written by Roger Barkan, Jennifer Berk, Jamie Coffin, Jed Goldstone, Heather Handley, Ann Jones, Ray Jones, Dan Katz, Kiran Kedlaya, Rose Koch, Brian Litofsky, Christopher Long, Catherine Moore, Chris Morse (Captain), Darren Rigby, Dave Savitt, and Brian Tivol.
37
+
38
+ <h3>The Hunt Introduction</h3>
39
+
40
+ <p>Welcome to MH2K! (That's Mystery Hunt 2000 for those of you
41
+ are acronymatically challenged.) This year, your puzzle-solving
42
+ skills are sorely needed in order to help our hero, Dorothy Gale,
43
+ return to her monochromatic homeland.</p>
44
+
45
+ <p>The Munchkin Information Processing Board (MIPB) has offered
46
+ to help Dorothy get home through the use of their newly designed
47
+ Tornado-Operated Object Levitator (T.O.O.L.) Unfortunately, as a
48
+ consequence of inventive eccentricity, the T.O.O.L. can only be
49
+ operated with a special coin, and nobody on MIPB can remember where
50
+ they left it. Your goal is to recover this coin.</p>
51
+
52
+ <p>Fortuitously, you have a powerful computer system to aid you
53
+ in your search. MIPB possesses a highly advanced network
54
+ affectionately known as the Wonderfully Intelligent Zenith of All
55
+ Recovery Devices (W.I.Z.A.R.D.) that should be able to scan the
56
+ campus and trace the location of the coin. However, Wendy the
57
+ Insidiously Tyrannical Computer Hacker (W.I.T.C.H.) has installed a
58
+ series of password blocks into W.I.Z.A.R.D. and no one knows how to
59
+ access its higher functions.</p>
60
+
61
+ <p>It is known that W.I.T.C.H. has a careless habit of inadvertently
62
+ leaving clues to her passwords around the MIT campus. Rather than make
63
+ you look for them, Dorothy has graciously volunteered to brave the
64
+ wild jungles of MIT in search of W.I.T.C.H.'s trail of devious
65
+ puzzles, taking a pocket W.I.Z.A.R.D. terminal with her that will
66
+ automatically record her adventures and post them online. Some of her
67
+ adventures may bring her into contact with some familiar faces; it
68
+ seems she's not the only one who had a recent run-in with a
69
+ tornado....</p>
70
+
71
+ <p>You, the remote solving team, must solve W.I.T.C.H.'s puzzles, and
72
+ extract from them a username and password, which will grant you access
73
+ to the appropriate puzzles to deduce the second username and password,
74
+ and so forth. Stay in contact with MIPB regarding your progress; they
75
+ are working together with you to discover the coin, and they'll be
76
+ glad to TRY to help you if you have questions.</p>
77
+
78
+ <p>Good luck, keep your wits about you, and remember: There's no
79
+ place like hell.</p>
80
+
81
+ <h3>The Hunt and Solutions (linked)</h3>
82
+ <ul>
83
+ <li><a href="set1">Puzzle Set 1</a></li>
84
+ <li><a href="set2">Puzzle Set 2</a></li>
85
+ <li><a href="set3">Puzzle Set 3</a></li>
86
+ <li><a href="set4">Puzzle Set 4</a></li>
87
+ <li><a href="set5">Puzzle Set 5</a></li>
88
+ <li><a href="endgame.html">Endgame</a></li>
89
+ </ul>
90
+
91
+ <h3>Photos</h3>
92
+ <p>The photos below were accompanied by the following announcement: <em>Insidious news! Bitter about the coin they lost last year, Carmen and her gang have caught up with Dorothy and are preparing to exact a cruel revenge. Film at 11. </em></p>
93
+
94
+ <div class="photowithlabel">
95
+ <img src="vilepics/dorothy.jpg" class="photoframe"><br><br>
96
+ <img src="vilepics/dorothycarmen.jpg" class="photoframe"><br><br>
97
+ <img src="vilepics/dorothydan.jpg" class="photoframe"><br><br>
98
+ <img src="vilepics/dorothyvile.jpg" class="photoframe"><br><br>
99
+ </div>
100
+
101
+ </main>
102
+ <div id="footer"></div>
103
+ </body>
104
+ <script type="module" src="/package.js"></script>
105
+ <script type="module" src="/Header.js"></script>
106
+ <script type="module" src="/Nav.js"></script>
107
+ <script type="module" src="/Title.js"></script>
108
+ <script type="module" src="/Toggle.js"></script>
109
+ <script type="module" src="/Footer.js"></script>
110
+ <script type="module" src="/main.js"></script>
111
+ </html>
benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1/Puzzle.html ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <html>
2
+
3
+ <head>
4
+ <title>
5
+
6
+
7
+ Mystery Hunt 2000, Puzzle 1.9
8
+
9
+ </title>
10
+ </head>
11
+
12
+ <body text=#303030 bgcolor=#ffffff link=#330066 alink=#000000 vlink=#000000>
13
+
14
+ <table width=100% border=0>
15
+ <tr><td align=left valign=top><h2>
16
+
17
+ <!-- XXX Edit this part here -->
18
+ 1.9: Oh, to be in DC
19
+
20
+ </h2></td>
21
+ <td align=right valign=top width=300>
22
+ <a href="../../index.html">Back to hunt</a> | <a href="../index.html">Back to puzzle set</a>
23
+ </td></tr></table>
24
+
25
+ <blockquote><i>
26
+
27
+ <!-- XXX Edit this part here -->
28
+
29
+ Dorothy went to see a W.I.Z.A.R.D. system administrator for some help getting into
30
+ the system, only to find the
31
+ following note posted on her door: <p>
32
+
33
+ <blockquote>
34
+ I'm on vacation this month. My itinerary is below; if you need to
35
+ get in touch with me, the standard people in each country will
36
+ have my address.<BR>
37
+ </blockquote>
38
+
39
+ </i></blockquote>
40
+
41
+ <pre>
42
+
43
+ TW 96 Friday, Jan 7 7:00 AM - 11:52 AM
44
+ LI 311 Friday, Jan 7 1:45 PM - 2:20 PM
45
+ LI 351 Friday, Jan 7 3:50 PM - 4:25 PM
46
+
47
+ Lodging: Seaview Hotel
48
+
49
+ IW 343 Wednesday, Jan 12 3:35 PM - Thursday, Jan 13 6:50 AM
50
+ TK 1828 Thursday, Jan 13 4:05 PM - Thursday, Jan 13 8:30 PM
51
+ TK 1386 Thursday, Jan 13 10:45 PM - Friday, Jan 14 3:05 AM
52
+
53
+ Lodging: Hotel Victoria
54
+
55
+ SR 3495 Sunday, Jan 16. 4:40 AM - 6:10 AM
56
+ TG 971 Sunday, Jan 16. 1:30 PM - 6:10 AM
57
+ TG 690 Monday, Jan 17 8:20 AM - 9:30 AM
58
+
59
+ Lodging: Belvedere Hotel
60
+
61
+ VN 820 Thursday, Jan 20 12:30 PM - 1:40 PM
62
+ VN 924 Thursday, Jan 20 3:00 PM - 7:15 PM
63
+ AA 7408 Thursday, Jan 20 11:30 PM - 6:15PM
64
+ AA 198 Thursday, Jan 20 10:00 PM - Friday, Jan 21 6:34 AM
65
+
66
+
67
+ </pre>
68
+
69
+ </body><script type="module" src="/checkanswer.js"></script>
70
+ </html>
benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1/Solution.html ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <html>
2
+
3
+ <head>
4
+ <title>
5
+
6
+
7
+ Mystery Hunt 2000, Set 1 Metapuzzle (Solution)
8
+
9
+ </title>
10
+ </head>
11
+
12
+ <body text=#303030 bgcolor=#ffffff link=#330066 alink=#000000 vlink=#000000>
13
+
14
+ <table border=0 width=100%>
15
+ <tr><td align=left valign=top><h2>
16
+
17
+
18
+ Set 1 Metapuzzle (Solution)
19
+
20
+ </h2></td>
21
+ <td align=right valign=top width=300>
22
+ <a href="../../index.html">Back to hunt</a> | <a href="../index.html">Back to puzzle set</a>
23
+ </td></tr></table>
24
+
25
+
26
+
27
+ <pre>
28
+ Author: Brian Tivol
29
+
30
+ The answers to the eleven puzzles can be arranged to form two fairly
31
+ long chains:
32
+
33
+ 1.10 EMERGENT
34
+ 1.3 GENTLE
35
+ 1.6 LEAN
36
+ 1.9 ANGELA
37
+ 1.4 GELATIN
38
+
39
+ 1.8 MANAGE
40
+ 1.5 AGES
41
+ 1.7 SIGNOR
42
+ 1.1 IGNORANT
43
+ 1.2 ANTHER
44
+ 1.11 HERALD
45
+
46
+ TIN MAN would join the two chains together. EMERALD is what you get
47
+ when you cross out every duplicated letter. Those two words are our
48
+ username and password for this round.
49
+
50
+ (This was probably the easiest round for backsolving answers.
51
+ However, one team had noticed the pattern, figured that EMERALD must
52
+ be the password, and tried to backsolve some of the words in the
53
+ middle of the chain. They determined that the GENTLE and IGNORANT
54
+ must be connected by LEMONS and MONSIGNOR; if that didn't completely
55
+ leave four other words in the cold, it would have been beautiful.)
56
+ </pre>
57
+
58
+ </body>
59
+ </html>
benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1/asset_index.html ADDED
@@ -0,0 +1,111 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <title>2000 Mystery Hunt · MIT Mystery Hunt / Puzzle Club</title>
6
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
7
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
8
+ <link
9
+ href="https://fonts.googleapis.com/css2?family=PT+Serif:ital,wght@0,400;0,700;1,400&family=Syncopate:wght@700&display=swap"
10
+ rel="stylesheet"
11
+ />
12
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
13
+ <link rel="stylesheet" href="/style.css" type="text/css" />
14
+ <meta
15
+ name="description"
16
+ content="The MIT Mystery Hunt is an internationally renowned puzzle competition which takes place every January on MIT campus and attracts hundreds of participants from all over the world."
17
+ />
18
+ <meta property="og:image" content="/images/header-coin.png" />
19
+ <meta
20
+ property="og:description"
21
+ content="The MIT Mystery Hunt is an internationally renowned puzzle competition which takes place every January on MIT campus and attracts hundreds of participants from all over the world."
22
+ />
23
+ </head>
24
+ <body>
25
+ <div id="header"></div>
26
+ <main id="main">
27
+
28
+ <h1><a href="../huntsbyyear.html">Archives</a> / 2000 Mystery Hunt </h1>
29
+
30
+ <h3>Description</h3>
31
+ <p> The 2000 Mystery Hunt was based on <em>Wizard of Oz</em> and asked teams to help guide Dorothy back
32
+ home using the Tornado-Operated Object Levitator (T.O.O.L.), which required a coin for its operation.</p>
33
+ <p> The coin was found at 2:18am on Sunday by Paintttniap, in a planter outside 9-136.</p>
34
+
35
+ <h3>Credits</h3>
36
+ The 2000 Mystery Hunt was written by Roger Barkan, Jennifer Berk, Jamie Coffin, Jed Goldstone, Heather Handley, Ann Jones, Ray Jones, Dan Katz, Kiran Kedlaya, Rose Koch, Brian Litofsky, Christopher Long, Catherine Moore, Chris Morse (Captain), Darren Rigby, Dave Savitt, and Brian Tivol.
37
+
38
+ <h3>The Hunt Introduction</h3>
39
+
40
+ <p>Welcome to MH2K! (That's Mystery Hunt 2000 for those of you
41
+ are acronymatically challenged.) This year, your puzzle-solving
42
+ skills are sorely needed in order to help our hero, Dorothy Gale,
43
+ return to her monochromatic homeland.</p>
44
+
45
+ <p>The Munchkin Information Processing Board (MIPB) has offered
46
+ to help Dorothy get home through the use of their newly designed
47
+ Tornado-Operated Object Levitator (T.O.O.L.) Unfortunately, as a
48
+ consequence of inventive eccentricity, the T.O.O.L. can only be
49
+ operated with a special coin, and nobody on MIPB can remember where
50
+ they left it. Your goal is to recover this coin.</p>
51
+
52
+ <p>Fortuitously, you have a powerful computer system to aid you
53
+ in your search. MIPB possesses a highly advanced network
54
+ affectionately known as the Wonderfully Intelligent Zenith of All
55
+ Recovery Devices (W.I.Z.A.R.D.) that should be able to scan the
56
+ campus and trace the location of the coin. However, Wendy the
57
+ Insidiously Tyrannical Computer Hacker (W.I.T.C.H.) has installed a
58
+ series of password blocks into W.I.Z.A.R.D. and no one knows how to
59
+ access its higher functions.</p>
60
+
61
+ <p>It is known that W.I.T.C.H. has a careless habit of inadvertently
62
+ leaving clues to her passwords around the MIT campus. Rather than make
63
+ you look for them, Dorothy has graciously volunteered to brave the
64
+ wild jungles of MIT in search of W.I.T.C.H.'s trail of devious
65
+ puzzles, taking a pocket W.I.Z.A.R.D. terminal with her that will
66
+ automatically record her adventures and post them online. Some of her
67
+ adventures may bring her into contact with some familiar faces; it
68
+ seems she's not the only one who had a recent run-in with a
69
+ tornado....</p>
70
+
71
+ <p>You, the remote solving team, must solve W.I.T.C.H.'s puzzles, and
72
+ extract from them a username and password, which will grant you access
73
+ to the appropriate puzzles to deduce the second username and password,
74
+ and so forth. Stay in contact with MIPB regarding your progress; they
75
+ are working together with you to discover the coin, and they'll be
76
+ glad to TRY to help you if you have questions.</p>
77
+
78
+ <p>Good luck, keep your wits about you, and remember: There's no
79
+ place like hell.</p>
80
+
81
+ <h3>The Hunt and Solutions (linked)</h3>
82
+ <ul>
83
+ <li><a href="set1">Puzzle Set 1</a></li>
84
+ <li><a href="set2">Puzzle Set 2</a></li>
85
+ <li><a href="set3">Puzzle Set 3</a></li>
86
+ <li><a href="set4">Puzzle Set 4</a></li>
87
+ <li><a href="set5">Puzzle Set 5</a></li>
88
+ <li><a href="endgame.html">Endgame</a></li>
89
+ </ul>
90
+
91
+ <h3>Photos</h3>
92
+ <p>The photos below were accompanied by the following announcement: <em>Insidious news! Bitter about the coin they lost last year, Carmen and her gang have caught up with Dorothy and are preparing to exact a cruel revenge. Film at 11. </em></p>
93
+
94
+ <div class="photowithlabel">
95
+ <img src="vilepics/dorothy.jpg" class="photoframe"><br><br>
96
+ <img src="vilepics/dorothycarmen.jpg" class="photoframe"><br><br>
97
+ <img src="vilepics/dorothydan.jpg" class="photoframe"><br><br>
98
+ <img src="vilepics/dorothyvile.jpg" class="photoframe"><br><br>
99
+ </div>
100
+
101
+ </main>
102
+ <div id="footer"></div>
103
+ </body>
104
+ <script type="module" src="/package.js"></script>
105
+ <script type="module" src="/Header.js"></script>
106
+ <script type="module" src="/Nav.js"></script>
107
+ <script type="module" src="/Title.js"></script>
108
+ <script type="module" src="/Toggle.js"></script>
109
+ <script type="module" src="/Footer.js"></script>
110
+ <script type="module" src="/main.js"></script>
111
+ </html>
benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1/checkanswer.js ADDED
@@ -0,0 +1,281 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Do this first so that layout shift isn't too bad:
2
+ const container = document.createElement("div");
3
+ container.style = `
4
+ font-size: 16px;
5
+ font-size: clamp(16px, 2.4vw, 21px);
6
+ height: 2.5em;
7
+ `;
8
+ document.body.prepend(container);
9
+
10
+ import { React, html, css, render } from "./package.js";
11
+
12
+ /**
13
+ * Remove non-alphanumeric characters.
14
+ */
15
+ const normalizeAnswer = (answer) => {
16
+ if (getYear() === 2003) {
17
+ if (document.URL.includes("teamGuest/2")) {
18
+ // Special case: 2003 R2, whose answers are emoji.
19
+ return answer.trim();
20
+ } else if (document.URL.includes("6_3")) {
21
+ // Special case: Answer is literal Greek letter.
22
+ return answer.trim();
23
+ }
24
+ }
25
+ return answer.toUpperCase().replaceAll(/[^A-Z0-9]/g, "");
26
+ };
27
+
28
+ /**
29
+ * Returns the year of the hunt we're in.
30
+ */
31
+ const getYear = () => {
32
+ return Number(RegExp(`^.*/([0-9]{4})/.*$`).exec(document.URL)?.[1] ?? 0);
33
+ };
34
+
35
+ /**
36
+ * Fetches the answers as a list of {url, answer, prompt, intermediate}.
37
+ */
38
+ const getData = async () => {
39
+ const res = await fetch("/answers.tsv");
40
+ const data = await res.text();
41
+ const [header, ...body] = data.split("\n");
42
+ const headers = header.trim().split("\t");
43
+ return body.map((row) => {
44
+ const res = {};
45
+ row.split("\t").forEach((item, i) => {
46
+ res[headers[i]] = item.trim();
47
+ });
48
+ return res;
49
+ });
50
+ };
51
+
52
+ /**
53
+ * Gets the base URL; removes trailing index.html and .html, removes everything
54
+ * before the year, and then removes trailing slash.
55
+ */
56
+ const getBase = (url) => {
57
+ const root =
58
+ RegExp(`^(.*/)index.html`).exec(url)?.[1] ??
59
+ RegExp(`^(.*).html`).exec(url)?.[1] ??
60
+ url;
61
+ const base = RegExp(`^.*/([0-9]{4}/.*)$`).exec(root)?.[1] ?? root;
62
+ return base.endsWith("/") ? base.slice(0, -1) : base;
63
+ };
64
+
65
+ /**
66
+ * Get all rows in the data corresponding to a given URL. Group by same prompt.
67
+ */
68
+ const getAnswers = (data, url) => {
69
+ const base = getBase(url);
70
+ const rows = data.filter((row) => getBase(row.url) === base);
71
+ const prompts = [];
72
+ for (const row of rows) {
73
+ const { prompt } = row;
74
+ const group = prompts.find((group) => group.prompt === prompt);
75
+ if (group) {
76
+ group.rows.push(row);
77
+ } else {
78
+ prompts.push({ prompt, rows: [row] });
79
+ }
80
+ }
81
+ return prompts;
82
+ };
83
+
84
+ /**
85
+ * A single textbox and submit button in the rows of possible responses.
86
+ */
87
+ const ResponseRow = ({ prompt, rows, setFeedback }) => {
88
+ const [response, setResponse] = React.useState("");
89
+
90
+ const form = css`
91
+ align-items: baseline;
92
+ display: flex;
93
+ justify-content: right;
94
+ margin-bottom: 0.5em;
95
+
96
+ @media (max-width: 600px) {
97
+ align-items: flex-start;
98
+ flex-direction: column;
99
+ }
100
+ `;
101
+
102
+ const input = css`
103
+ background: #fafafa;
104
+ border: 1px solid #aaa;
105
+ border-radius: 2px;
106
+ color: #121212;
107
+ font-family: inherit;
108
+ font-size: 100%;
109
+ line-height: 1.2;
110
+ margin: 0 0.5em;
111
+ padding: 0.25em 0.5em;
112
+
113
+ @media (max-width: 600px) {
114
+ margin: 0 0 0.25em;
115
+ }
116
+ `;
117
+
118
+ const onSubmit = (e) => {
119
+ e.preventDefault();
120
+ let set = false;
121
+ for (const row of rows) {
122
+ const correct = normalizeAnswer(row.answer) === normalizeAnswer(response);
123
+ if (correct) {
124
+ setFeedback(
125
+ row.intermediate?.trim() === "TRUE"
126
+ ? "Correct! See the solution page for the answer."
127
+ : `Solved! The answer was ${row.answer}.`
128
+ );
129
+ set = true;
130
+ break;
131
+ }
132
+ }
133
+ if (!set) {
134
+ setFeedback("Incorrect.");
135
+ }
136
+ };
137
+
138
+ const onChange = (e) => setResponse(e.target.value);
139
+
140
+ return html`
141
+ <form class=${form} onSubmit=${onSubmit}>
142
+ <label htmlFor=${prompt + " prompt"}>
143
+ ${prompt || "Enter your guess"}:
144
+ </label>
145
+ <input
146
+ class=${input}
147
+ id=${prompt + " prompt"}
148
+ onChange=${onChange}
149
+ required
150
+ type="text"
151
+ value=${response}
152
+ />
153
+ <button type="submit">Submit</button>
154
+ </form>
155
+ `;
156
+ };
157
+
158
+ /**
159
+ * Check answer button, rendered at top of page.
160
+ */
161
+ const CheckButton = ({ prompts }) => {
162
+ const [open, setOpen] = React.useState(false);
163
+ const [feedback, setFeedback] = React.useState("Call in an answer.");
164
+
165
+ const wrapper = css`
166
+ font-family: "PT Sans", sans-serif;
167
+ font-size: 16px;
168
+ font-size: clamp(16px, 2.4vw, 21px);
169
+ height: 2.5em;
170
+
171
+ button {
172
+ background: #555;
173
+ border: none;
174
+ border-radius: 2px;
175
+ color: #fff;
176
+ cursor: pointer;
177
+ display: inline-block;
178
+ font-size: 1em;
179
+ font-family: "PT Sans", sans-serif;
180
+ font-weight: bold;
181
+ line-height: 1.2;
182
+ padding: 0.25em 1em;
183
+ text-align: center;
184
+ text-decoration: none;
185
+ text-transform: none;
186
+ }
187
+
188
+ p {
189
+ margin: 0 0 1em;
190
+ }
191
+
192
+ a {
193
+ color: inherit !important;
194
+ }
195
+ `;
196
+
197
+ const btnTop = [2015, 2016].includes(getYear())
198
+ ? "50px"
199
+ : [2012].includes(getYear())
200
+ ? "-2.5em"
201
+ : "0px";
202
+
203
+ const button = css`
204
+ box-sizing: border-box;
205
+ height: 2.5em;
206
+ left: 0;
207
+ position: absolute;
208
+ top: ${btnTop};
209
+ width: 100%;
210
+ z-index: 9999;
211
+ `;
212
+
213
+ const dropdownWrapper = css`
214
+ background: #edeff0;
215
+ color: #121212;
216
+ left: 0;
217
+ position: absolute;
218
+ right: 0;
219
+ top: calc(2.5em + ${btnTop});
220
+ z-index: 9999;
221
+ `;
222
+
223
+ const dropdown = css`
224
+ margin: 0 auto;
225
+ max-width: 40em;
226
+ padding: 1em;
227
+ z-index: 9999;
228
+ `;
229
+
230
+ const responses = css`
231
+ margin: 0 auto;
232
+ width: fit-content;
233
+
234
+ @media (max-width: 600px) {
235
+ width: auto;
236
+ }
237
+ `;
238
+
239
+ const onClick = () => setOpen(!open);
240
+
241
+ const body =
242
+ prompts.length > 0
243
+ ? prompts.map(
244
+ (group) =>
245
+ html`<${ResponseRow} setFeedback=${setFeedback} ...${group} />`
246
+ )
247
+ : html`<p>
248
+ No answers found on this page. Please report this to${" "}
249
+ <a href="mailto:puzzle@mit.edu">puzzle@mit.edu</a>.
250
+ </p>`;
251
+
252
+ return html`
253
+ <style>
254
+ @import url("https://fonts.googleapis.com/css2?family=PT+Sans:wght@400;700&display=swap");
255
+
256
+ ${[2015, 2016].includes(getYear()) &&
257
+ ".navbar-fixed-top { z-index: 10000 }"}
258
+ ${[2012].includes(getYear()) &&
259
+ "body { top: 2.5em } #check-answer, #shortcuts { z-index: 10000 !important }"}
260
+ ${[2006].includes(getYear()) && 'img[alt="Check Answer"] { display: none }'}
261
+ </style>
262
+ <div class=${wrapper}>
263
+ <button class=${button} onClick=${onClick}>
264
+ Check your answers spoiler-free
265
+ </button>
266
+ ${open &&
267
+ html`
268
+ <div class=${dropdownWrapper}>
269
+ <div class=${dropdown}>
270
+ <p>${feedback}</p>
271
+ <div class=${responses}>${body}</div>
272
+ </div>
273
+ </div>
274
+ `}
275
+ </div>
276
+ `;
277
+ };
278
+
279
+ const data = await getData();
280
+ const prompts = getAnswers(data, document.URL);
281
+ render(html`<${CheckButton} prompts=${prompts} />`, container);
benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1/hint1.txt ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ HINT 1
2
+
3
+ VICTOR
4
+ THEODORE
5
+ DAMASCUS
6
+ MARTIN
7
+ ADRIAN
8
+ SOTER
9
+
benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1/index.html ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <HTML>
2
+ <HEAD>
3
+ <TITLE>Mystery Hunt 2000, Set 1</TITLE>
4
+ <LINK REV=owns HREF="mailto:puzzle@mit.edu">
5
+ </HEAD>
6
+
7
+ <BODY TEXT="#303030" BGCOLOR="#FFFFFF" LINK="#330066" ALINK="#000000"
8
+ VLINK="#000000">
9
+
10
+
11
+
12
+ <table width=100% border=0>
13
+ <tr><td align=left valign=top><h2>
14
+
15
+ <H3>Puzzles, Set 1</H3>
16
+
17
+ </h2></td>
18
+ <td align=right valign=top width=300>
19
+ <a href="../index.html">Back to hunt</a>
20
+ </td></tr></table>
21
+
22
+
23
+ <BLOCKQUOTE>
24
+ <A HREF="1/Puzzle.html">Puzzle 1</A> <A HREF="1/Solution.html">Solution 1</A><BR>
25
+ <A HREF="2/Puzzle.html">Puzzle 2</A> <A HREF="2/Solution.html">Solution 2</A><BR>
26
+ <A HREF="3/Puzzle.html">Puzzle 3</A> <A HREF="3/Solution.html">Solution 3</A><BR>
27
+ <A HREF="4/Puzzle.html">Puzzle 4</A> <A HREF="4/Solution.html">Solution 4</A><BR>
28
+ <A HREF="5/Puzzle.html">Puzzle 5</A> <A HREF="5/Solution.html">Solution 5</A><BR>
29
+ <A HREF="6/Puzzle.html">Puzzle 6</A> <A HREF="6/Solution.html">Solution 6</A><BR>
30
+ <A HREF="7/Puzzle.html">Puzzle 7</A> <A HREF="7/Solution.html">Solution 7</A><BR>
31
+ <A HREF="8/Puzzle.html">Puzzle 8</A> <A HREF="8/Solution.html">Solution 8</A><BR>
32
+ <A HREF="9/Puzzle.html">Puzzle 9</A> <A HREF="9/Solution.html">Solution 9</A><BR>
33
+ <A HREF="10/Puzzle.html">Puzzle 10</A> <A HREF="10/Solution.html">Solution 10</A><BR>
34
+ <A HREF="11/Puzzle.html">Puzzle 11</A> <A HREF="11/Solution.html">Solution 11</A><BR>
35
+ <BR>
36
+ <A HREF="../hints/hint1.txt">Hint</A> <A HREF="../hints/solution1.txt">Hint Solution</A><BR>
37
+ <A HREF="Meta/Solution.html">Metapuzzle Solution</A><BR>
38
+ </BLOCKQUOTE>
39
+ If you participated in the Hunt, please fill out the <A HREF="../survey.txt">survey</A>.
40
+
41
+ </BODY><script type="module" src="/checkanswer.js"></script>
42
+ </HTML>
benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1/solution1.txt ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ HINT 1 Solution
2
+
3
+ Author: Chris Morse
4
+
5
+ The names are all of popes. If you look at the Nth letter of their
6
+ name, where N is the number of the last pope to use that name:
7
+
8
+ VICTOR III
9
+ THEODORE II
10
+ DAMASCUS II
11
+ MARTIN V
12
+ ADRIAN VI
13
+ SOTER I
14
+
15
+ you get the answer CHAINS
benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1/survey.txt ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ We hope you aren't tired of answering our questions, but there is one
3
+ last set we'd like you to try out. Your comments will help future
4
+ Hunts from succumbing to our pitfalls and possibly give us a warm
5
+ fuzzy feeling inside. You can answer either as teams or individuals,
6
+ as you see fit.
7
+
8
+ 1. What is your team's name?
9
+
10
+ 2. How many years has your team competed in the Mystery Hunt? How
11
+ many full-time solvers and how many come-and-go solvers were on
12
+ your team?
13
+
14
+ 3. What are your overall impressions of this year's Hunt?
15
+
16
+ 4. Do you feel as if you'd want to return next year?
17
+
18
+ 5. Did you feel there were any administrative or logistical problems
19
+ this year that future organizers could be warned about?
20
+
21
+ 6. Is there a specific member of MIPB you'd like to send a message to?
22
+ Is there a specific puzzle whose creator you'd like to send a
23
+ message to?
24
+
25
+ 7. Which puzzles did you find to be...
26
+ ...the most enjoyable?
27
+ ...the least enjoyable?
28
+ ...(in)elegant?
29
+ ...(un)memorable?
30
+ ...conducive to silly quotes?
31
+ (Feel free to list more than one for each category; extra comments
32
+ appreciated.)
33
+
34
+ 8. What sorts of comments worthy of preservation and ridicule did your
35
+ team members blurt out? Do you have any comic stories worth
36
+ retelling?
37
+
38
+ 9. Do you have any other generic comments?
39
+
40
+ Please send surveys to puzzle@mit.edu.
benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1_10_Puzzle.html/Puzzle.html ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <html>
2
+
3
+ <head>
4
+ <title>
5
+
6
+ Mystery Hunt 2000, Puzzle 1.10
7
+
8
+ </title>
9
+ </head>
10
+
11
+ <body text=#303030 bgcolor=#ffffff link=#330066 alink=#000000 vlink=#000000>
12
+
13
+ <table border=0 width=100%>
14
+ <tr><td align=left valign=top><h2>
15
+
16
+ <!-- XXX Edit this part here -->
17
+ 1.10: Ad-verse Opinion
18
+
19
+ </h2></td>
20
+ <td align=right valign=top width=300>
21
+ <a href="../../index.html">Back to hunt</a> | <a href="../index.html">Back to puzzle set</a>
22
+ </td></tr></table>
23
+
24
+ <blockquote><i>
25
+
26
+ <!-- XXX Edit this part here -->
27
+
28
+ Dorothy wandered down the infinite corridor, trying doorknobs and
29
+ looking for <b>anything</b> that might help her find her way. She
30
+ finally came to a door labelled "C M Vest" that was open. She
31
+ opened the door and cautiously looked around the office to see what
32
+ there was to see. Nothing useful appeared to get accomplished in this office.
33
+ Perhaps now she knew why -- on the computer screen was this hideous
34
+ example of poetry. Was this what he did all day?
35
+
36
+ </i></blockquote>
37
+
38
+
39
+
40
+ <body>
41
+ I'll craft a homily, I'll test in fear<br>
42
+ In a daze my dear face you'll see<br>
43
+ Inky fate teases you, no rest you'll get<br>
44
+ Upon a sweet defeat you join greater ill<br>
45
+ You fear a million ill faces as fated<br>
46
+ You are acceded no minion, dared no rest<br>
47
+ You were saved on fast craft tagged Joy<br>
48
+ Jolly, greatest test ever in staged phony ploy<br>
49
+ </body><script type="module" src="/checkanswer.js"></script>
50
+ </html>
benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1_10_Puzzle.html/checkanswer.js ADDED
@@ -0,0 +1,281 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Do this first so that layout shift isn't too bad:
2
+ const container = document.createElement("div");
3
+ container.style = `
4
+ font-size: 16px;
5
+ font-size: clamp(16px, 2.4vw, 21px);
6
+ height: 2.5em;
7
+ `;
8
+ document.body.prepend(container);
9
+
10
+ import { React, html, css, render } from "./package.js";
11
+
12
+ /**
13
+ * Remove non-alphanumeric characters.
14
+ */
15
+ const normalizeAnswer = (answer) => {
16
+ if (getYear() === 2003) {
17
+ if (document.URL.includes("teamGuest/2")) {
18
+ // Special case: 2003 R2, whose answers are emoji.
19
+ return answer.trim();
20
+ } else if (document.URL.includes("6_3")) {
21
+ // Special case: Answer is literal Greek letter.
22
+ return answer.trim();
23
+ }
24
+ }
25
+ return answer.toUpperCase().replaceAll(/[^A-Z0-9]/g, "");
26
+ };
27
+
28
+ /**
29
+ * Returns the year of the hunt we're in.
30
+ */
31
+ const getYear = () => {
32
+ return Number(RegExp(`^.*/([0-9]{4})/.*$`).exec(document.URL)?.[1] ?? 0);
33
+ };
34
+
35
+ /**
36
+ * Fetches the answers as a list of {url, answer, prompt, intermediate}.
37
+ */
38
+ const getData = async () => {
39
+ const res = await fetch("/answers.tsv");
40
+ const data = await res.text();
41
+ const [header, ...body] = data.split("\n");
42
+ const headers = header.trim().split("\t");
43
+ return body.map((row) => {
44
+ const res = {};
45
+ row.split("\t").forEach((item, i) => {
46
+ res[headers[i]] = item.trim();
47
+ });
48
+ return res;
49
+ });
50
+ };
51
+
52
+ /**
53
+ * Gets the base URL; removes trailing index.html and .html, removes everything
54
+ * before the year, and then removes trailing slash.
55
+ */
56
+ const getBase = (url) => {
57
+ const root =
58
+ RegExp(`^(.*/)index.html`).exec(url)?.[1] ??
59
+ RegExp(`^(.*).html`).exec(url)?.[1] ??
60
+ url;
61
+ const base = RegExp(`^.*/([0-9]{4}/.*)$`).exec(root)?.[1] ?? root;
62
+ return base.endsWith("/") ? base.slice(0, -1) : base;
63
+ };
64
+
65
+ /**
66
+ * Get all rows in the data corresponding to a given URL. Group by same prompt.
67
+ */
68
+ const getAnswers = (data, url) => {
69
+ const base = getBase(url);
70
+ const rows = data.filter((row) => getBase(row.url) === base);
71
+ const prompts = [];
72
+ for (const row of rows) {
73
+ const { prompt } = row;
74
+ const group = prompts.find((group) => group.prompt === prompt);
75
+ if (group) {
76
+ group.rows.push(row);
77
+ } else {
78
+ prompts.push({ prompt, rows: [row] });
79
+ }
80
+ }
81
+ return prompts;
82
+ };
83
+
84
+ /**
85
+ * A single textbox and submit button in the rows of possible responses.
86
+ */
87
+ const ResponseRow = ({ prompt, rows, setFeedback }) => {
88
+ const [response, setResponse] = React.useState("");
89
+
90
+ const form = css`
91
+ align-items: baseline;
92
+ display: flex;
93
+ justify-content: right;
94
+ margin-bottom: 0.5em;
95
+
96
+ @media (max-width: 600px) {
97
+ align-items: flex-start;
98
+ flex-direction: column;
99
+ }
100
+ `;
101
+
102
+ const input = css`
103
+ background: #fafafa;
104
+ border: 1px solid #aaa;
105
+ border-radius: 2px;
106
+ color: #121212;
107
+ font-family: inherit;
108
+ font-size: 100%;
109
+ line-height: 1.2;
110
+ margin: 0 0.5em;
111
+ padding: 0.25em 0.5em;
112
+
113
+ @media (max-width: 600px) {
114
+ margin: 0 0 0.25em;
115
+ }
116
+ `;
117
+
118
+ const onSubmit = (e) => {
119
+ e.preventDefault();
120
+ let set = false;
121
+ for (const row of rows) {
122
+ const correct = normalizeAnswer(row.answer) === normalizeAnswer(response);
123
+ if (correct) {
124
+ setFeedback(
125
+ row.intermediate?.trim() === "TRUE"
126
+ ? "Correct! See the solution page for the answer."
127
+ : `Solved! The answer was ${row.answer}.`
128
+ );
129
+ set = true;
130
+ break;
131
+ }
132
+ }
133
+ if (!set) {
134
+ setFeedback("Incorrect.");
135
+ }
136
+ };
137
+
138
+ const onChange = (e) => setResponse(e.target.value);
139
+
140
+ return html`
141
+ <form class=${form} onSubmit=${onSubmit}>
142
+ <label htmlFor=${prompt + " prompt"}>
143
+ ${prompt || "Enter your guess"}:
144
+ </label>
145
+ <input
146
+ class=${input}
147
+ id=${prompt + " prompt"}
148
+ onChange=${onChange}
149
+ required
150
+ type="text"
151
+ value=${response}
152
+ />
153
+ <button type="submit">Submit</button>
154
+ </form>
155
+ `;
156
+ };
157
+
158
+ /**
159
+ * Check answer button, rendered at top of page.
160
+ */
161
+ const CheckButton = ({ prompts }) => {
162
+ const [open, setOpen] = React.useState(false);
163
+ const [feedback, setFeedback] = React.useState("Call in an answer.");
164
+
165
+ const wrapper = css`
166
+ font-family: "PT Sans", sans-serif;
167
+ font-size: 16px;
168
+ font-size: clamp(16px, 2.4vw, 21px);
169
+ height: 2.5em;
170
+
171
+ button {
172
+ background: #555;
173
+ border: none;
174
+ border-radius: 2px;
175
+ color: #fff;
176
+ cursor: pointer;
177
+ display: inline-block;
178
+ font-size: 1em;
179
+ font-family: "PT Sans", sans-serif;
180
+ font-weight: bold;
181
+ line-height: 1.2;
182
+ padding: 0.25em 1em;
183
+ text-align: center;
184
+ text-decoration: none;
185
+ text-transform: none;
186
+ }
187
+
188
+ p {
189
+ margin: 0 0 1em;
190
+ }
191
+
192
+ a {
193
+ color: inherit !important;
194
+ }
195
+ `;
196
+
197
+ const btnTop = [2015, 2016].includes(getYear())
198
+ ? "50px"
199
+ : [2012].includes(getYear())
200
+ ? "-2.5em"
201
+ : "0px";
202
+
203
+ const button = css`
204
+ box-sizing: border-box;
205
+ height: 2.5em;
206
+ left: 0;
207
+ position: absolute;
208
+ top: ${btnTop};
209
+ width: 100%;
210
+ z-index: 9999;
211
+ `;
212
+
213
+ const dropdownWrapper = css`
214
+ background: #edeff0;
215
+ color: #121212;
216
+ left: 0;
217
+ position: absolute;
218
+ right: 0;
219
+ top: calc(2.5em + ${btnTop});
220
+ z-index: 9999;
221
+ `;
222
+
223
+ const dropdown = css`
224
+ margin: 0 auto;
225
+ max-width: 40em;
226
+ padding: 1em;
227
+ z-index: 9999;
228
+ `;
229
+
230
+ const responses = css`
231
+ margin: 0 auto;
232
+ width: fit-content;
233
+
234
+ @media (max-width: 600px) {
235
+ width: auto;
236
+ }
237
+ `;
238
+
239
+ const onClick = () => setOpen(!open);
240
+
241
+ const body =
242
+ prompts.length > 0
243
+ ? prompts.map(
244
+ (group) =>
245
+ html`<${ResponseRow} setFeedback=${setFeedback} ...${group} />`
246
+ )
247
+ : html`<p>
248
+ No answers found on this page. Please report this to${" "}
249
+ <a href="mailto:puzzle@mit.edu">puzzle@mit.edu</a>.
250
+ </p>`;
251
+
252
+ return html`
253
+ <style>
254
+ @import url("https://fonts.googleapis.com/css2?family=PT+Sans:wght@400;700&display=swap");
255
+
256
+ ${[2015, 2016].includes(getYear()) &&
257
+ ".navbar-fixed-top { z-index: 10000 }"}
258
+ ${[2012].includes(getYear()) &&
259
+ "body { top: 2.5em } #check-answer, #shortcuts { z-index: 10000 !important }"}
260
+ ${[2006].includes(getYear()) && 'img[alt="Check Answer"] { display: none }'}
261
+ </style>
262
+ <div class=${wrapper}>
263
+ <button class=${button} onClick=${onClick}>
264
+ Check your answers spoiler-free
265
+ </button>
266
+ ${open &&
267
+ html`
268
+ <div class=${dropdownWrapper}>
269
+ <div class=${dropdown}>
270
+ <p>${feedback}</p>
271
+ <div class=${responses}>${body}</div>
272
+ </div>
273
+ </div>
274
+ `}
275
+ </div>
276
+ `;
277
+ };
278
+
279
+ const data = await getData();
280
+ const prompts = getAnswers(data, document.URL);
281
+ render(html`<${CheckButton} prompts=${prompts} />`, container);
benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1_10_Puzzle.html/index.html ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <HTML>
2
+ <HEAD>
3
+ <TITLE>Mystery Hunt 2000, Set 1</TITLE>
4
+ <LINK REV=owns HREF="mailto:puzzle@mit.edu">
5
+ </HEAD>
6
+
7
+ <BODY TEXT="#303030" BGCOLOR="#FFFFFF" LINK="#330066" ALINK="#000000"
8
+ VLINK="#000000">
9
+
10
+
11
+
12
+ <table width=100% border=0>
13
+ <tr><td align=left valign=top><h2>
14
+
15
+ <H3>Puzzles, Set 1</H3>
16
+
17
+ </h2></td>
18
+ <td align=right valign=top width=300>
19
+ <a href="../index.html">Back to hunt</a>
20
+ </td></tr></table>
21
+
22
+
23
+ <BLOCKQUOTE>
24
+ <A HREF="1/Puzzle.html">Puzzle 1</A> <A HREF="1/Solution.html">Solution 1</A><BR>
25
+ <A HREF="2/Puzzle.html">Puzzle 2</A> <A HREF="2/Solution.html">Solution 2</A><BR>
26
+ <A HREF="3/Puzzle.html">Puzzle 3</A> <A HREF="3/Solution.html">Solution 3</A><BR>
27
+ <A HREF="4/Puzzle.html">Puzzle 4</A> <A HREF="4/Solution.html">Solution 4</A><BR>
28
+ <A HREF="5/Puzzle.html">Puzzle 5</A> <A HREF="5/Solution.html">Solution 5</A><BR>
29
+ <A HREF="6/Puzzle.html">Puzzle 6</A> <A HREF="6/Solution.html">Solution 6</A><BR>
30
+ <A HREF="7/Puzzle.html">Puzzle 7</A> <A HREF="7/Solution.html">Solution 7</A><BR>
31
+ <A HREF="8/Puzzle.html">Puzzle 8</A> <A HREF="8/Solution.html">Solution 8</A><BR>
32
+ <A HREF="9/Puzzle.html">Puzzle 9</A> <A HREF="9/Solution.html">Solution 9</A><BR>
33
+ <A HREF="10/Puzzle.html">Puzzle 10</A> <A HREF="10/Solution.html">Solution 10</A><BR>
34
+ <A HREF="11/Puzzle.html">Puzzle 11</A> <A HREF="11/Solution.html">Solution 11</A><BR>
35
+ <BR>
36
+ <A HREF="../hints/hint1.txt">Hint</A> <A HREF="../hints/solution1.txt">Hint Solution</A><BR>
37
+ <A HREF="Meta/Solution.html">Metapuzzle Solution</A><BR>
38
+ </BLOCKQUOTE>
39
+ If you participated in the Hunt, please fill out the <A HREF="../survey.txt">survey</A>.
40
+
41
+ </BODY><script type="module" src="/checkanswer.js"></script>
42
+ </HTML>
benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1_11_Puzzle.html/Puzzle.html ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <html>
2
+
3
+ <head>
4
+ <title>
5
+
6
+
7
+ Mystery Hunt 2000, Puzzle 1.11
8
+
9
+
10
+ </title>
11
+ </head>
12
+
13
+ <body text=#303030 bgcolor=#ffffff link=#330066 alink=#000000 vlink=#000000>
14
+
15
+ <table border=0 width=100%>
16
+ <tr><td align=left valign=top><h2>
17
+
18
+ <!-- XXX Edit this part here -->
19
+ 1.11: Primate Conflict
20
+
21
+ </h2></td>
22
+ <td align=right valign=top width=300>
23
+ <a href="../../index.html">Back to hunt</a> | <a href="../index.html">Back to puzzle set</a>
24
+ </td></tr></table>
25
+
26
+ <blockquote><i>
27
+
28
+
29
+ <p>
30
+ Wandering about the 'tute, Dorothy's mind wandered as
31
+ well and she reminisced about the attack by the flying
32
+ monkeys. Even though she was pretty sure it wouldn't
33
+ happen here, she started to think of some other famous
34
+ battles....
35
+ </i></blockquote>
36
+
37
+ <body>
38
+
39
+ <table COLS=2 WIDTH="700" >
40
+ <tr>
41
+ <td>Battle of Wakefield
42
+ <br>Battle of Kirina
43
+ <br>&nbsp;</td>
44
+
45
+ <td>Battle of Mortimer's Cross
46
+ <br>Battle of Arsuf
47
+ <br>&nbsp;</td>
48
+ </tr>
49
+
50
+ <tr>
51
+ <td>Battle of Blood River
52
+ <br>Siege de Toulon
53
+ <br>&nbsp;</td>
54
+
55
+ <td>Battle of Nancy
56
+ <br>Battle of Stirling
57
+ <br>&nbsp;</td>
58
+ </tr>
59
+
60
+ <tr>
61
+ <td>Battle of Granicus River
62
+ <br>Battle of Delion
63
+ <br>&nbsp;</td>
64
+
65
+ <td>Battle of Minatogawa
66
+ <br>Battle of Hastings&nbsp;
67
+ <br>&nbsp;</td>
68
+ </tr>
69
+
70
+ <tr>
71
+ <td>Battle of Hungna
72
+ <br>Battle of Cesme
73
+ <br>&nbsp;</td>
74
+
75
+ <td>Battle of Leipzig
76
+ <br>Battle of Gravelines
77
+ <br>&nbsp;</td>
78
+ </tr>
79
+
80
+ <tr>
81
+ <td>Battle of Kasserine Pass
82
+ <br>Battle of Manila Bay
83
+ <br>&nbsp;</td>
84
+
85
+ <td>Naval Battle of La Rochelle
86
+ <br>Conquest of Lisboa
87
+ <br>&nbsp;</td>
88
+ </tr>
89
+
90
+ <tr>
91
+ <td>Battle of Talikota
92
+ <br>Battle of Aljubarrota
93
+ <br>&nbsp;</td>
94
+
95
+ <td>Battle of Manzikert
96
+ <br>Battle of Guadelete
97
+ <br>&nbsp;</td>
98
+ </tr>
99
+ </table>
100
+
101
+ </body><script type="module" src="/checkanswer.js"></script>
102
+ </html>
103
+
104
+
105
+
106
+
107
+
108
+
benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1_11_Puzzle.html/checkanswer.js ADDED
@@ -0,0 +1,281 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Do this first so that layout shift isn't too bad:
2
+ const container = document.createElement("div");
3
+ container.style = `
4
+ font-size: 16px;
5
+ font-size: clamp(16px, 2.4vw, 21px);
6
+ height: 2.5em;
7
+ `;
8
+ document.body.prepend(container);
9
+
10
+ import { React, html, css, render } from "./package.js";
11
+
12
+ /**
13
+ * Remove non-alphanumeric characters.
14
+ */
15
+ const normalizeAnswer = (answer) => {
16
+ if (getYear() === 2003) {
17
+ if (document.URL.includes("teamGuest/2")) {
18
+ // Special case: 2003 R2, whose answers are emoji.
19
+ return answer.trim();
20
+ } else if (document.URL.includes("6_3")) {
21
+ // Special case: Answer is literal Greek letter.
22
+ return answer.trim();
23
+ }
24
+ }
25
+ return answer.toUpperCase().replaceAll(/[^A-Z0-9]/g, "");
26
+ };
27
+
28
+ /**
29
+ * Returns the year of the hunt we're in.
30
+ */
31
+ const getYear = () => {
32
+ return Number(RegExp(`^.*/([0-9]{4})/.*$`).exec(document.URL)?.[1] ?? 0);
33
+ };
34
+
35
+ /**
36
+ * Fetches the answers as a list of {url, answer, prompt, intermediate}.
37
+ */
38
+ const getData = async () => {
39
+ const res = await fetch("/answers.tsv");
40
+ const data = await res.text();
41
+ const [header, ...body] = data.split("\n");
42
+ const headers = header.trim().split("\t");
43
+ return body.map((row) => {
44
+ const res = {};
45
+ row.split("\t").forEach((item, i) => {
46
+ res[headers[i]] = item.trim();
47
+ });
48
+ return res;
49
+ });
50
+ };
51
+
52
+ /**
53
+ * Gets the base URL; removes trailing index.html and .html, removes everything
54
+ * before the year, and then removes trailing slash.
55
+ */
56
+ const getBase = (url) => {
57
+ const root =
58
+ RegExp(`^(.*/)index.html`).exec(url)?.[1] ??
59
+ RegExp(`^(.*).html`).exec(url)?.[1] ??
60
+ url;
61
+ const base = RegExp(`^.*/([0-9]{4}/.*)$`).exec(root)?.[1] ?? root;
62
+ return base.endsWith("/") ? base.slice(0, -1) : base;
63
+ };
64
+
65
+ /**
66
+ * Get all rows in the data corresponding to a given URL. Group by same prompt.
67
+ */
68
+ const getAnswers = (data, url) => {
69
+ const base = getBase(url);
70
+ const rows = data.filter((row) => getBase(row.url) === base);
71
+ const prompts = [];
72
+ for (const row of rows) {
73
+ const { prompt } = row;
74
+ const group = prompts.find((group) => group.prompt === prompt);
75
+ if (group) {
76
+ group.rows.push(row);
77
+ } else {
78
+ prompts.push({ prompt, rows: [row] });
79
+ }
80
+ }
81
+ return prompts;
82
+ };
83
+
84
+ /**
85
+ * A single textbox and submit button in the rows of possible responses.
86
+ */
87
+ const ResponseRow = ({ prompt, rows, setFeedback }) => {
88
+ const [response, setResponse] = React.useState("");
89
+
90
+ const form = css`
91
+ align-items: baseline;
92
+ display: flex;
93
+ justify-content: right;
94
+ margin-bottom: 0.5em;
95
+
96
+ @media (max-width: 600px) {
97
+ align-items: flex-start;
98
+ flex-direction: column;
99
+ }
100
+ `;
101
+
102
+ const input = css`
103
+ background: #fafafa;
104
+ border: 1px solid #aaa;
105
+ border-radius: 2px;
106
+ color: #121212;
107
+ font-family: inherit;
108
+ font-size: 100%;
109
+ line-height: 1.2;
110
+ margin: 0 0.5em;
111
+ padding: 0.25em 0.5em;
112
+
113
+ @media (max-width: 600px) {
114
+ margin: 0 0 0.25em;
115
+ }
116
+ `;
117
+
118
+ const onSubmit = (e) => {
119
+ e.preventDefault();
120
+ let set = false;
121
+ for (const row of rows) {
122
+ const correct = normalizeAnswer(row.answer) === normalizeAnswer(response);
123
+ if (correct) {
124
+ setFeedback(
125
+ row.intermediate?.trim() === "TRUE"
126
+ ? "Correct! See the solution page for the answer."
127
+ : `Solved! The answer was ${row.answer}.`
128
+ );
129
+ set = true;
130
+ break;
131
+ }
132
+ }
133
+ if (!set) {
134
+ setFeedback("Incorrect.");
135
+ }
136
+ };
137
+
138
+ const onChange = (e) => setResponse(e.target.value);
139
+
140
+ return html`
141
+ <form class=${form} onSubmit=${onSubmit}>
142
+ <label htmlFor=${prompt + " prompt"}>
143
+ ${prompt || "Enter your guess"}:
144
+ </label>
145
+ <input
146
+ class=${input}
147
+ id=${prompt + " prompt"}
148
+ onChange=${onChange}
149
+ required
150
+ type="text"
151
+ value=${response}
152
+ />
153
+ <button type="submit">Submit</button>
154
+ </form>
155
+ `;
156
+ };
157
+
158
+ /**
159
+ * Check answer button, rendered at top of page.
160
+ */
161
+ const CheckButton = ({ prompts }) => {
162
+ const [open, setOpen] = React.useState(false);
163
+ const [feedback, setFeedback] = React.useState("Call in an answer.");
164
+
165
+ const wrapper = css`
166
+ font-family: "PT Sans", sans-serif;
167
+ font-size: 16px;
168
+ font-size: clamp(16px, 2.4vw, 21px);
169
+ height: 2.5em;
170
+
171
+ button {
172
+ background: #555;
173
+ border: none;
174
+ border-radius: 2px;
175
+ color: #fff;
176
+ cursor: pointer;
177
+ display: inline-block;
178
+ font-size: 1em;
179
+ font-family: "PT Sans", sans-serif;
180
+ font-weight: bold;
181
+ line-height: 1.2;
182
+ padding: 0.25em 1em;
183
+ text-align: center;
184
+ text-decoration: none;
185
+ text-transform: none;
186
+ }
187
+
188
+ p {
189
+ margin: 0 0 1em;
190
+ }
191
+
192
+ a {
193
+ color: inherit !important;
194
+ }
195
+ `;
196
+
197
+ const btnTop = [2015, 2016].includes(getYear())
198
+ ? "50px"
199
+ : [2012].includes(getYear())
200
+ ? "-2.5em"
201
+ : "0px";
202
+
203
+ const button = css`
204
+ box-sizing: border-box;
205
+ height: 2.5em;
206
+ left: 0;
207
+ position: absolute;
208
+ top: ${btnTop};
209
+ width: 100%;
210
+ z-index: 9999;
211
+ `;
212
+
213
+ const dropdownWrapper = css`
214
+ background: #edeff0;
215
+ color: #121212;
216
+ left: 0;
217
+ position: absolute;
218
+ right: 0;
219
+ top: calc(2.5em + ${btnTop});
220
+ z-index: 9999;
221
+ `;
222
+
223
+ const dropdown = css`
224
+ margin: 0 auto;
225
+ max-width: 40em;
226
+ padding: 1em;
227
+ z-index: 9999;
228
+ `;
229
+
230
+ const responses = css`
231
+ margin: 0 auto;
232
+ width: fit-content;
233
+
234
+ @media (max-width: 600px) {
235
+ width: auto;
236
+ }
237
+ `;
238
+
239
+ const onClick = () => setOpen(!open);
240
+
241
+ const body =
242
+ prompts.length > 0
243
+ ? prompts.map(
244
+ (group) =>
245
+ html`<${ResponseRow} setFeedback=${setFeedback} ...${group} />`
246
+ )
247
+ : html`<p>
248
+ No answers found on this page. Please report this to${" "}
249
+ <a href="mailto:puzzle@mit.edu">puzzle@mit.edu</a>.
250
+ </p>`;
251
+
252
+ return html`
253
+ <style>
254
+ @import url("https://fonts.googleapis.com/css2?family=PT+Sans:wght@400;700&display=swap");
255
+
256
+ ${[2015, 2016].includes(getYear()) &&
257
+ ".navbar-fixed-top { z-index: 10000 }"}
258
+ ${[2012].includes(getYear()) &&
259
+ "body { top: 2.5em } #check-answer, #shortcuts { z-index: 10000 !important }"}
260
+ ${[2006].includes(getYear()) && 'img[alt="Check Answer"] { display: none }'}
261
+ </style>
262
+ <div class=${wrapper}>
263
+ <button class=${button} onClick=${onClick}>
264
+ Check your answers spoiler-free
265
+ </button>
266
+ ${open &&
267
+ html`
268
+ <div class=${dropdownWrapper}>
269
+ <div class=${dropdown}>
270
+ <p>${feedback}</p>
271
+ <div class=${responses}>${body}</div>
272
+ </div>
273
+ </div>
274
+ `}
275
+ </div>
276
+ `;
277
+ };
278
+
279
+ const data = await getData();
280
+ const prompts = getAnswers(data, document.URL);
281
+ render(html`<${CheckButton} prompts=${prompts} />`, container);
benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1_11_Puzzle.html/index.html ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <HTML>
2
+ <HEAD>
3
+ <TITLE>Mystery Hunt 2000, Set 1</TITLE>
4
+ <LINK REV=owns HREF="mailto:puzzle@mit.edu">
5
+ </HEAD>
6
+
7
+ <BODY TEXT="#303030" BGCOLOR="#FFFFFF" LINK="#330066" ALINK="#000000"
8
+ VLINK="#000000">
9
+
10
+
11
+
12
+ <table width=100% border=0>
13
+ <tr><td align=left valign=top><h2>
14
+
15
+ <H3>Puzzles, Set 1</H3>
16
+
17
+ </h2></td>
18
+ <td align=right valign=top width=300>
19
+ <a href="../index.html">Back to hunt</a>
20
+ </td></tr></table>
21
+
22
+
23
+ <BLOCKQUOTE>
24
+ <A HREF="1/Puzzle.html">Puzzle 1</A> <A HREF="1/Solution.html">Solution 1</A><BR>
25
+ <A HREF="2/Puzzle.html">Puzzle 2</A> <A HREF="2/Solution.html">Solution 2</A><BR>
26
+ <A HREF="3/Puzzle.html">Puzzle 3</A> <A HREF="3/Solution.html">Solution 3</A><BR>
27
+ <A HREF="4/Puzzle.html">Puzzle 4</A> <A HREF="4/Solution.html">Solution 4</A><BR>
28
+ <A HREF="5/Puzzle.html">Puzzle 5</A> <A HREF="5/Solution.html">Solution 5</A><BR>
29
+ <A HREF="6/Puzzle.html">Puzzle 6</A> <A HREF="6/Solution.html">Solution 6</A><BR>
30
+ <A HREF="7/Puzzle.html">Puzzle 7</A> <A HREF="7/Solution.html">Solution 7</A><BR>
31
+ <A HREF="8/Puzzle.html">Puzzle 8</A> <A HREF="8/Solution.html">Solution 8</A><BR>
32
+ <A HREF="9/Puzzle.html">Puzzle 9</A> <A HREF="9/Solution.html">Solution 9</A><BR>
33
+ <A HREF="10/Puzzle.html">Puzzle 10</A> <A HREF="10/Solution.html">Solution 10</A><BR>
34
+ <A HREF="11/Puzzle.html">Puzzle 11</A> <A HREF="11/Solution.html">Solution 11</A><BR>
35
+ <BR>
36
+ <A HREF="../hints/hint1.txt">Hint</A> <A HREF="../hints/solution1.txt">Hint Solution</A><BR>
37
+ <A HREF="Meta/Solution.html">Metapuzzle Solution</A><BR>
38
+ </BLOCKQUOTE>
39
+ If you participated in the Hunt, please fill out the <A HREF="../survey.txt">survey</A>.
40
+
41
+ </BODY><script type="module" src="/checkanswer.js"></script>
42
+ </HTML>
benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1_1_Puzzle.html/Puzzle.html ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <html>
2
+
3
+ <head>
4
+ <title>
5
+
6
+ Mystery Hunt 2000, Puzzle 1.1
7
+
8
+ </title>
9
+ </head>
10
+
11
+ <body text=#303030 bgcolor=#ffffff link=#330066 alink=#000000 vlink=#000000>
12
+
13
+ <table width=100% border=0>
14
+ <tr><td align=left valign=top><h2>
15
+
16
+ 1.1: Alternatives
17
+
18
+ </h2></td>
19
+ <td align=right valign=top width=300>
20
+ <a href="../../index.html">Back to hunt</a> | <a href="../index.html">Back to puzzle set</a>
21
+ </td></tr></table>
22
+
23
+ <blockquote><i>
24
+
25
+ "Gosh, Lion, the course offerings at MIT really do run the gamut, don't they?"<p>
26
+ "Darn right they do. So many choices," fretted the Lion. "How will I ever decide?"
27
+
28
+ </i></blockquote>
29
+
30
+
31
+ Abidjan resident
32
+ <br>
33
+ Bouffant or beehive sources
34
+ <br>
35
+ Colorado ski resort
36
+ <br>
37
+ Deficient in ethical principles
38
+ <br>
39
+ External wall covering
40
+ <br>
41
+ Fitness freak Richard
42
+ <br>
43
+ Gibbon of Sumatra
44
+ <br>
45
+ Horse outfitter
46
+ <br>
47
+ Interjection expressing happiness
48
+ <br>
49
+ Jealous, desirous person
50
+ <br>
51
+ Kid's shoebox project
52
+ <br>
53
+ Lupanar, in slang
54
+ <br>
55
+ Make happen
56
+ <br>
57
+ Negative terminal, in an electrolytic cell
58
+ <br>
59
+ One-time Princess of Wales
60
+ <br>
61
+ Prima donna
62
+ <br>
63
+ Quantum mechanics pioneer Eugene
64
+ <br>
65
+ Redolent
66
+ <br>
67
+ Store temporarily, as a web page
68
+ <br>
69
+ Toiler
70
+ <br>
71
+ Unnecessary or excessive chatter
72
+ <br>
73
+ Vocal ensemble
74
+ <br>
75
+ Will it play there?
76
+ <br>
77
+ Xiamen, Vientiane or Jaipur native
78
+ <br>
79
+ "You Make Me Feel Like Dancing" singer
80
+ <br>
81
+ Zaian or Zemmour tribe member
82
+
83
+
84
+ </body><script type="module" src="/checkanswer.js"></script>
85
+ </html>
benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1_1_Puzzle.html/checkanswer.js ADDED
@@ -0,0 +1,281 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Do this first so that layout shift isn't too bad:
2
+ const container = document.createElement("div");
3
+ container.style = `
4
+ font-size: 16px;
5
+ font-size: clamp(16px, 2.4vw, 21px);
6
+ height: 2.5em;
7
+ `;
8
+ document.body.prepend(container);
9
+
10
+ import { React, html, css, render } from "./package.js";
11
+
12
+ /**
13
+ * Remove non-alphanumeric characters.
14
+ */
15
+ const normalizeAnswer = (answer) => {
16
+ if (getYear() === 2003) {
17
+ if (document.URL.includes("teamGuest/2")) {
18
+ // Special case: 2003 R2, whose answers are emoji.
19
+ return answer.trim();
20
+ } else if (document.URL.includes("6_3")) {
21
+ // Special case: Answer is literal Greek letter.
22
+ return answer.trim();
23
+ }
24
+ }
25
+ return answer.toUpperCase().replaceAll(/[^A-Z0-9]/g, "");
26
+ };
27
+
28
+ /**
29
+ * Returns the year of the hunt we're in.
30
+ */
31
+ const getYear = () => {
32
+ return Number(RegExp(`^.*/([0-9]{4})/.*$`).exec(document.URL)?.[1] ?? 0);
33
+ };
34
+
35
+ /**
36
+ * Fetches the answers as a list of {url, answer, prompt, intermediate}.
37
+ */
38
+ const getData = async () => {
39
+ const res = await fetch("/answers.tsv");
40
+ const data = await res.text();
41
+ const [header, ...body] = data.split("\n");
42
+ const headers = header.trim().split("\t");
43
+ return body.map((row) => {
44
+ const res = {};
45
+ row.split("\t").forEach((item, i) => {
46
+ res[headers[i]] = item.trim();
47
+ });
48
+ return res;
49
+ });
50
+ };
51
+
52
+ /**
53
+ * Gets the base URL; removes trailing index.html and .html, removes everything
54
+ * before the year, and then removes trailing slash.
55
+ */
56
+ const getBase = (url) => {
57
+ const root =
58
+ RegExp(`^(.*/)index.html`).exec(url)?.[1] ??
59
+ RegExp(`^(.*).html`).exec(url)?.[1] ??
60
+ url;
61
+ const base = RegExp(`^.*/([0-9]{4}/.*)$`).exec(root)?.[1] ?? root;
62
+ return base.endsWith("/") ? base.slice(0, -1) : base;
63
+ };
64
+
65
+ /**
66
+ * Get all rows in the data corresponding to a given URL. Group by same prompt.
67
+ */
68
+ const getAnswers = (data, url) => {
69
+ const base = getBase(url);
70
+ const rows = data.filter((row) => getBase(row.url) === base);
71
+ const prompts = [];
72
+ for (const row of rows) {
73
+ const { prompt } = row;
74
+ const group = prompts.find((group) => group.prompt === prompt);
75
+ if (group) {
76
+ group.rows.push(row);
77
+ } else {
78
+ prompts.push({ prompt, rows: [row] });
79
+ }
80
+ }
81
+ return prompts;
82
+ };
83
+
84
+ /**
85
+ * A single textbox and submit button in the rows of possible responses.
86
+ */
87
+ const ResponseRow = ({ prompt, rows, setFeedback }) => {
88
+ const [response, setResponse] = React.useState("");
89
+
90
+ const form = css`
91
+ align-items: baseline;
92
+ display: flex;
93
+ justify-content: right;
94
+ margin-bottom: 0.5em;
95
+
96
+ @media (max-width: 600px) {
97
+ align-items: flex-start;
98
+ flex-direction: column;
99
+ }
100
+ `;
101
+
102
+ const input = css`
103
+ background: #fafafa;
104
+ border: 1px solid #aaa;
105
+ border-radius: 2px;
106
+ color: #121212;
107
+ font-family: inherit;
108
+ font-size: 100%;
109
+ line-height: 1.2;
110
+ margin: 0 0.5em;
111
+ padding: 0.25em 0.5em;
112
+
113
+ @media (max-width: 600px) {
114
+ margin: 0 0 0.25em;
115
+ }
116
+ `;
117
+
118
+ const onSubmit = (e) => {
119
+ e.preventDefault();
120
+ let set = false;
121
+ for (const row of rows) {
122
+ const correct = normalizeAnswer(row.answer) === normalizeAnswer(response);
123
+ if (correct) {
124
+ setFeedback(
125
+ row.intermediate?.trim() === "TRUE"
126
+ ? "Correct! See the solution page for the answer."
127
+ : `Solved! The answer was ${row.answer}.`
128
+ );
129
+ set = true;
130
+ break;
131
+ }
132
+ }
133
+ if (!set) {
134
+ setFeedback("Incorrect.");
135
+ }
136
+ };
137
+
138
+ const onChange = (e) => setResponse(e.target.value);
139
+
140
+ return html`
141
+ <form class=${form} onSubmit=${onSubmit}>
142
+ <label htmlFor=${prompt + " prompt"}>
143
+ ${prompt || "Enter your guess"}:
144
+ </label>
145
+ <input
146
+ class=${input}
147
+ id=${prompt + " prompt"}
148
+ onChange=${onChange}
149
+ required
150
+ type="text"
151
+ value=${response}
152
+ />
153
+ <button type="submit">Submit</button>
154
+ </form>
155
+ `;
156
+ };
157
+
158
+ /**
159
+ * Check answer button, rendered at top of page.
160
+ */
161
+ const CheckButton = ({ prompts }) => {
162
+ const [open, setOpen] = React.useState(false);
163
+ const [feedback, setFeedback] = React.useState("Call in an answer.");
164
+
165
+ const wrapper = css`
166
+ font-family: "PT Sans", sans-serif;
167
+ font-size: 16px;
168
+ font-size: clamp(16px, 2.4vw, 21px);
169
+ height: 2.5em;
170
+
171
+ button {
172
+ background: #555;
173
+ border: none;
174
+ border-radius: 2px;
175
+ color: #fff;
176
+ cursor: pointer;
177
+ display: inline-block;
178
+ font-size: 1em;
179
+ font-family: "PT Sans", sans-serif;
180
+ font-weight: bold;
181
+ line-height: 1.2;
182
+ padding: 0.25em 1em;
183
+ text-align: center;
184
+ text-decoration: none;
185
+ text-transform: none;
186
+ }
187
+
188
+ p {
189
+ margin: 0 0 1em;
190
+ }
191
+
192
+ a {
193
+ color: inherit !important;
194
+ }
195
+ `;
196
+
197
+ const btnTop = [2015, 2016].includes(getYear())
198
+ ? "50px"
199
+ : [2012].includes(getYear())
200
+ ? "-2.5em"
201
+ : "0px";
202
+
203
+ const button = css`
204
+ box-sizing: border-box;
205
+ height: 2.5em;
206
+ left: 0;
207
+ position: absolute;
208
+ top: ${btnTop};
209
+ width: 100%;
210
+ z-index: 9999;
211
+ `;
212
+
213
+ const dropdownWrapper = css`
214
+ background: #edeff0;
215
+ color: #121212;
216
+ left: 0;
217
+ position: absolute;
218
+ right: 0;
219
+ top: calc(2.5em + ${btnTop});
220
+ z-index: 9999;
221
+ `;
222
+
223
+ const dropdown = css`
224
+ margin: 0 auto;
225
+ max-width: 40em;
226
+ padding: 1em;
227
+ z-index: 9999;
228
+ `;
229
+
230
+ const responses = css`
231
+ margin: 0 auto;
232
+ width: fit-content;
233
+
234
+ @media (max-width: 600px) {
235
+ width: auto;
236
+ }
237
+ `;
238
+
239
+ const onClick = () => setOpen(!open);
240
+
241
+ const body =
242
+ prompts.length > 0
243
+ ? prompts.map(
244
+ (group) =>
245
+ html`<${ResponseRow} setFeedback=${setFeedback} ...${group} />`
246
+ )
247
+ : html`<p>
248
+ No answers found on this page. Please report this to${" "}
249
+ <a href="mailto:puzzle@mit.edu">puzzle@mit.edu</a>.
250
+ </p>`;
251
+
252
+ return html`
253
+ <style>
254
+ @import url("https://fonts.googleapis.com/css2?family=PT+Sans:wght@400;700&display=swap");
255
+
256
+ ${[2015, 2016].includes(getYear()) &&
257
+ ".navbar-fixed-top { z-index: 10000 }"}
258
+ ${[2012].includes(getYear()) &&
259
+ "body { top: 2.5em } #check-answer, #shortcuts { z-index: 10000 !important }"}
260
+ ${[2006].includes(getYear()) && 'img[alt="Check Answer"] { display: none }'}
261
+ </style>
262
+ <div class=${wrapper}>
263
+ <button class=${button} onClick=${onClick}>
264
+ Check your answers spoiler-free
265
+ </button>
266
+ ${open &&
267
+ html`
268
+ <div class=${dropdownWrapper}>
269
+ <div class=${dropdown}>
270
+ <p>${feedback}</p>
271
+ <div class=${responses}>${body}</div>
272
+ </div>
273
+ </div>
274
+ `}
275
+ </div>
276
+ `;
277
+ };
278
+
279
+ const data = await getData();
280
+ const prompts = getAnswers(data, document.URL);
281
+ render(html`<${CheckButton} prompts=${prompts} />`, container);
benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1_1_Puzzle.html/index.html ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <HTML>
2
+ <HEAD>
3
+ <TITLE>Mystery Hunt 2000, Set 1</TITLE>
4
+ <LINK REV=owns HREF="mailto:puzzle@mit.edu">
5
+ </HEAD>
6
+
7
+ <BODY TEXT="#303030" BGCOLOR="#FFFFFF" LINK="#330066" ALINK="#000000"
8
+ VLINK="#000000">
9
+
10
+
11
+
12
+ <table width=100% border=0>
13
+ <tr><td align=left valign=top><h2>
14
+
15
+ <H3>Puzzles, Set 1</H3>
16
+
17
+ </h2></td>
18
+ <td align=right valign=top width=300>
19
+ <a href="../index.html">Back to hunt</a>
20
+ </td></tr></table>
21
+
22
+
23
+ <BLOCKQUOTE>
24
+ <A HREF="1/Puzzle.html">Puzzle 1</A> <A HREF="1/Solution.html">Solution 1</A><BR>
25
+ <A HREF="2/Puzzle.html">Puzzle 2</A> <A HREF="2/Solution.html">Solution 2</A><BR>
26
+ <A HREF="3/Puzzle.html">Puzzle 3</A> <A HREF="3/Solution.html">Solution 3</A><BR>
27
+ <A HREF="4/Puzzle.html">Puzzle 4</A> <A HREF="4/Solution.html">Solution 4</A><BR>
28
+ <A HREF="5/Puzzle.html">Puzzle 5</A> <A HREF="5/Solution.html">Solution 5</A><BR>
29
+ <A HREF="6/Puzzle.html">Puzzle 6</A> <A HREF="6/Solution.html">Solution 6</A><BR>
30
+ <A HREF="7/Puzzle.html">Puzzle 7</A> <A HREF="7/Solution.html">Solution 7</A><BR>
31
+ <A HREF="8/Puzzle.html">Puzzle 8</A> <A HREF="8/Solution.html">Solution 8</A><BR>
32
+ <A HREF="9/Puzzle.html">Puzzle 9</A> <A HREF="9/Solution.html">Solution 9</A><BR>
33
+ <A HREF="10/Puzzle.html">Puzzle 10</A> <A HREF="10/Solution.html">Solution 10</A><BR>
34
+ <A HREF="11/Puzzle.html">Puzzle 11</A> <A HREF="11/Solution.html">Solution 11</A><BR>
35
+ <BR>
36
+ <A HREF="../hints/hint1.txt">Hint</A> <A HREF="../hints/solution1.txt">Hint Solution</A><BR>
37
+ <A HREF="Meta/Solution.html">Metapuzzle Solution</A><BR>
38
+ </BLOCKQUOTE>
39
+ If you participated in the Hunt, please fill out the <A HREF="../survey.txt">survey</A>.
40
+
41
+ </BODY><script type="module" src="/checkanswer.js"></script>
42
+ </HTML>
benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1_2_Puzzle.html/Puzzle.html ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <html>
2
+
3
+ <head>
4
+ <title>
5
+
6
+ Mystery Hunt 2000, Puzzle 1.2
7
+
8
+ </title>
9
+ </head>
10
+
11
+ <body text=#303030 bgcolor=#ffffff link=#330066 alink=#000000 vlink=#000000>
12
+
13
+ <table width=100% border=0>
14
+ <tr><td align=left valign=top><h2>
15
+
16
+ 1.2: Recommended Reading
17
+
18
+ </h2></td>
19
+ <td align=right valign=top width=300>
20
+ <a href="../../index.html">Back to hunt</a> | <a href="../index.html">Back to puzzle set</a>
21
+ </td></tr></table>
22
+
23
+ <blockquote><i>
24
+
25
+ Dorothy marveled at the Scarecrow's collection. "Scarecrow, you sure have
26
+ been reading a lot lately!"<p>
27
+
28
+ "Absolutely! See, after I failed 18.01 I decided to switch from
29
+ mechanical engineering to literature." <p>
30
+
31
+ "You failed 18.01? Is that Pythagorean theorem still giving you trouble?"
32
+ <p>
33
+
34
+ "Don't remind me. Course 21 is much easier, you see:
35
+ writers use a lot of words but end up
36
+ not saying very much."
37
+ <p>
38
+ "Oh, you mean the way you do?"
39
+ <p>
40
+ The Scarecrow glared at Dorothy in disapproval.
41
+
42
+ </i></blockquote>
43
+
44
+ <pre>
45
+
46
+ ---- -- - ---- -- - ---- -- - ----. (1913)
47
+ A A
48
+
49
+
50
+ -- --- --- ---- -- -----, -- --- --- ----- -- -----, ... (1859)
51
+ AA BB
52
+
53
+
54
+ --- ----- -- -- ------ - -----, --- ----- -- -- ------ - -----. (1923)
55
+ B A A
56
+
57
+
58
+ --- ---- -- ---- ---- ---, --- ---- -- ---- ----, --- ---- -- ----- ---- --- ... (1954)
59
+ A B
60
+
61
+
62
+ ------ -- -----, ----- ------, ... (1820)
63
+ BB B A
64
+
65
+
66
+ ---- - ------, ---- - ------, ---- - ------ ------, ... (1854)
67
+ A BB
68
+
69
+ </pre>
70
+
71
+ </body><script type="module" src="/checkanswer.js"></script>
72
+ </html>
benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1_2_Puzzle.html/checkanswer.js ADDED
@@ -0,0 +1,281 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Do this first so that layout shift isn't too bad:
2
+ const container = document.createElement("div");
3
+ container.style = `
4
+ font-size: 16px;
5
+ font-size: clamp(16px, 2.4vw, 21px);
6
+ height: 2.5em;
7
+ `;
8
+ document.body.prepend(container);
9
+
10
+ import { React, html, css, render } from "./package.js";
11
+
12
+ /**
13
+ * Remove non-alphanumeric characters.
14
+ */
15
+ const normalizeAnswer = (answer) => {
16
+ if (getYear() === 2003) {
17
+ if (document.URL.includes("teamGuest/2")) {
18
+ // Special case: 2003 R2, whose answers are emoji.
19
+ return answer.trim();
20
+ } else if (document.URL.includes("6_3")) {
21
+ // Special case: Answer is literal Greek letter.
22
+ return answer.trim();
23
+ }
24
+ }
25
+ return answer.toUpperCase().replaceAll(/[^A-Z0-9]/g, "");
26
+ };
27
+
28
+ /**
29
+ * Returns the year of the hunt we're in.
30
+ */
31
+ const getYear = () => {
32
+ return Number(RegExp(`^.*/([0-9]{4})/.*$`).exec(document.URL)?.[1] ?? 0);
33
+ };
34
+
35
+ /**
36
+ * Fetches the answers as a list of {url, answer, prompt, intermediate}.
37
+ */
38
+ const getData = async () => {
39
+ const res = await fetch("/answers.tsv");
40
+ const data = await res.text();
41
+ const [header, ...body] = data.split("\n");
42
+ const headers = header.trim().split("\t");
43
+ return body.map((row) => {
44
+ const res = {};
45
+ row.split("\t").forEach((item, i) => {
46
+ res[headers[i]] = item.trim();
47
+ });
48
+ return res;
49
+ });
50
+ };
51
+
52
+ /**
53
+ * Gets the base URL; removes trailing index.html and .html, removes everything
54
+ * before the year, and then removes trailing slash.
55
+ */
56
+ const getBase = (url) => {
57
+ const root =
58
+ RegExp(`^(.*/)index.html`).exec(url)?.[1] ??
59
+ RegExp(`^(.*).html`).exec(url)?.[1] ??
60
+ url;
61
+ const base = RegExp(`^.*/([0-9]{4}/.*)$`).exec(root)?.[1] ?? root;
62
+ return base.endsWith("/") ? base.slice(0, -1) : base;
63
+ };
64
+
65
+ /**
66
+ * Get all rows in the data corresponding to a given URL. Group by same prompt.
67
+ */
68
+ const getAnswers = (data, url) => {
69
+ const base = getBase(url);
70
+ const rows = data.filter((row) => getBase(row.url) === base);
71
+ const prompts = [];
72
+ for (const row of rows) {
73
+ const { prompt } = row;
74
+ const group = prompts.find((group) => group.prompt === prompt);
75
+ if (group) {
76
+ group.rows.push(row);
77
+ } else {
78
+ prompts.push({ prompt, rows: [row] });
79
+ }
80
+ }
81
+ return prompts;
82
+ };
83
+
84
+ /**
85
+ * A single textbox and submit button in the rows of possible responses.
86
+ */
87
+ const ResponseRow = ({ prompt, rows, setFeedback }) => {
88
+ const [response, setResponse] = React.useState("");
89
+
90
+ const form = css`
91
+ align-items: baseline;
92
+ display: flex;
93
+ justify-content: right;
94
+ margin-bottom: 0.5em;
95
+
96
+ @media (max-width: 600px) {
97
+ align-items: flex-start;
98
+ flex-direction: column;
99
+ }
100
+ `;
101
+
102
+ const input = css`
103
+ background: #fafafa;
104
+ border: 1px solid #aaa;
105
+ border-radius: 2px;
106
+ color: #121212;
107
+ font-family: inherit;
108
+ font-size: 100%;
109
+ line-height: 1.2;
110
+ margin: 0 0.5em;
111
+ padding: 0.25em 0.5em;
112
+
113
+ @media (max-width: 600px) {
114
+ margin: 0 0 0.25em;
115
+ }
116
+ `;
117
+
118
+ const onSubmit = (e) => {
119
+ e.preventDefault();
120
+ let set = false;
121
+ for (const row of rows) {
122
+ const correct = normalizeAnswer(row.answer) === normalizeAnswer(response);
123
+ if (correct) {
124
+ setFeedback(
125
+ row.intermediate?.trim() === "TRUE"
126
+ ? "Correct! See the solution page for the answer."
127
+ : `Solved! The answer was ${row.answer}.`
128
+ );
129
+ set = true;
130
+ break;
131
+ }
132
+ }
133
+ if (!set) {
134
+ setFeedback("Incorrect.");
135
+ }
136
+ };
137
+
138
+ const onChange = (e) => setResponse(e.target.value);
139
+
140
+ return html`
141
+ <form class=${form} onSubmit=${onSubmit}>
142
+ <label htmlFor=${prompt + " prompt"}>
143
+ ${prompt || "Enter your guess"}:
144
+ </label>
145
+ <input
146
+ class=${input}
147
+ id=${prompt + " prompt"}
148
+ onChange=${onChange}
149
+ required
150
+ type="text"
151
+ value=${response}
152
+ />
153
+ <button type="submit">Submit</button>
154
+ </form>
155
+ `;
156
+ };
157
+
158
+ /**
159
+ * Check answer button, rendered at top of page.
160
+ */
161
+ const CheckButton = ({ prompts }) => {
162
+ const [open, setOpen] = React.useState(false);
163
+ const [feedback, setFeedback] = React.useState("Call in an answer.");
164
+
165
+ const wrapper = css`
166
+ font-family: "PT Sans", sans-serif;
167
+ font-size: 16px;
168
+ font-size: clamp(16px, 2.4vw, 21px);
169
+ height: 2.5em;
170
+
171
+ button {
172
+ background: #555;
173
+ border: none;
174
+ border-radius: 2px;
175
+ color: #fff;
176
+ cursor: pointer;
177
+ display: inline-block;
178
+ font-size: 1em;
179
+ font-family: "PT Sans", sans-serif;
180
+ font-weight: bold;
181
+ line-height: 1.2;
182
+ padding: 0.25em 1em;
183
+ text-align: center;
184
+ text-decoration: none;
185
+ text-transform: none;
186
+ }
187
+
188
+ p {
189
+ margin: 0 0 1em;
190
+ }
191
+
192
+ a {
193
+ color: inherit !important;
194
+ }
195
+ `;
196
+
197
+ const btnTop = [2015, 2016].includes(getYear())
198
+ ? "50px"
199
+ : [2012].includes(getYear())
200
+ ? "-2.5em"
201
+ : "0px";
202
+
203
+ const button = css`
204
+ box-sizing: border-box;
205
+ height: 2.5em;
206
+ left: 0;
207
+ position: absolute;
208
+ top: ${btnTop};
209
+ width: 100%;
210
+ z-index: 9999;
211
+ `;
212
+
213
+ const dropdownWrapper = css`
214
+ background: #edeff0;
215
+ color: #121212;
216
+ left: 0;
217
+ position: absolute;
218
+ right: 0;
219
+ top: calc(2.5em + ${btnTop});
220
+ z-index: 9999;
221
+ `;
222
+
223
+ const dropdown = css`
224
+ margin: 0 auto;
225
+ max-width: 40em;
226
+ padding: 1em;
227
+ z-index: 9999;
228
+ `;
229
+
230
+ const responses = css`
231
+ margin: 0 auto;
232
+ width: fit-content;
233
+
234
+ @media (max-width: 600px) {
235
+ width: auto;
236
+ }
237
+ `;
238
+
239
+ const onClick = () => setOpen(!open);
240
+
241
+ const body =
242
+ prompts.length > 0
243
+ ? prompts.map(
244
+ (group) =>
245
+ html`<${ResponseRow} setFeedback=${setFeedback} ...${group} />`
246
+ )
247
+ : html`<p>
248
+ No answers found on this page. Please report this to${" "}
249
+ <a href="mailto:puzzle@mit.edu">puzzle@mit.edu</a>.
250
+ </p>`;
251
+
252
+ return html`
253
+ <style>
254
+ @import url("https://fonts.googleapis.com/css2?family=PT+Sans:wght@400;700&display=swap");
255
+
256
+ ${[2015, 2016].includes(getYear()) &&
257
+ ".navbar-fixed-top { z-index: 10000 }"}
258
+ ${[2012].includes(getYear()) &&
259
+ "body { top: 2.5em } #check-answer, #shortcuts { z-index: 10000 !important }"}
260
+ ${[2006].includes(getYear()) && 'img[alt="Check Answer"] { display: none }'}
261
+ </style>
262
+ <div class=${wrapper}>
263
+ <button class=${button} onClick=${onClick}>
264
+ Check your answers spoiler-free
265
+ </button>
266
+ ${open &&
267
+ html`
268
+ <div class=${dropdownWrapper}>
269
+ <div class=${dropdown}>
270
+ <p>${feedback}</p>
271
+ <div class=${responses}>${body}</div>
272
+ </div>
273
+ </div>
274
+ `}
275
+ </div>
276
+ `;
277
+ };
278
+
279
+ const data = await getData();
280
+ const prompts = getAnswers(data, document.URL);
281
+ render(html`<${CheckButton} prompts=${prompts} />`, container);
benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1_2_Puzzle.html/index.html ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <HTML>
2
+ <HEAD>
3
+ <TITLE>Mystery Hunt 2000, Set 1</TITLE>
4
+ <LINK REV=owns HREF="mailto:puzzle@mit.edu">
5
+ </HEAD>
6
+
7
+ <BODY TEXT="#303030" BGCOLOR="#FFFFFF" LINK="#330066" ALINK="#000000"
8
+ VLINK="#000000">
9
+
10
+
11
+
12
+ <table width=100% border=0>
13
+ <tr><td align=left valign=top><h2>
14
+
15
+ <H3>Puzzles, Set 1</H3>
16
+
17
+ </h2></td>
18
+ <td align=right valign=top width=300>
19
+ <a href="../index.html">Back to hunt</a>
20
+ </td></tr></table>
21
+
22
+
23
+ <BLOCKQUOTE>
24
+ <A HREF="1/Puzzle.html">Puzzle 1</A> <A HREF="1/Solution.html">Solution 1</A><BR>
25
+ <A HREF="2/Puzzle.html">Puzzle 2</A> <A HREF="2/Solution.html">Solution 2</A><BR>
26
+ <A HREF="3/Puzzle.html">Puzzle 3</A> <A HREF="3/Solution.html">Solution 3</A><BR>
27
+ <A HREF="4/Puzzle.html">Puzzle 4</A> <A HREF="4/Solution.html">Solution 4</A><BR>
28
+ <A HREF="5/Puzzle.html">Puzzle 5</A> <A HREF="5/Solution.html">Solution 5</A><BR>
29
+ <A HREF="6/Puzzle.html">Puzzle 6</A> <A HREF="6/Solution.html">Solution 6</A><BR>
30
+ <A HREF="7/Puzzle.html">Puzzle 7</A> <A HREF="7/Solution.html">Solution 7</A><BR>
31
+ <A HREF="8/Puzzle.html">Puzzle 8</A> <A HREF="8/Solution.html">Solution 8</A><BR>
32
+ <A HREF="9/Puzzle.html">Puzzle 9</A> <A HREF="9/Solution.html">Solution 9</A><BR>
33
+ <A HREF="10/Puzzle.html">Puzzle 10</A> <A HREF="10/Solution.html">Solution 10</A><BR>
34
+ <A HREF="11/Puzzle.html">Puzzle 11</A> <A HREF="11/Solution.html">Solution 11</A><BR>
35
+ <BR>
36
+ <A HREF="../hints/hint1.txt">Hint</A> <A HREF="../hints/solution1.txt">Hint Solution</A><BR>
37
+ <A HREF="Meta/Solution.html">Metapuzzle Solution</A><BR>
38
+ </BLOCKQUOTE>
39
+ If you participated in the Hunt, please fill out the <A HREF="../survey.txt">survey</A>.
40
+
41
+ </BODY><script type="module" src="/checkanswer.js"></script>
42
+ </HTML>
benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1_3_Puzzle.html/Puzzle.html ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <html>
2
+
3
+ <head>
4
+ <title>
5
+
6
+
7
+ Mystery Hunt 2000, Puzzle 1.3
8
+
9
+ </title>
10
+ </head>
11
+
12
+ <body text=#303030 bgcolor=#ffffff link=#330066 alink=#000000 vlink=#000000>
13
+
14
+ <table border=0 width=100%>
15
+ <tr><td align=left valign=top><h2>
16
+
17
+
18
+ 1.3: Dorothy Helps a Hack
19
+
20
+ </h2></td>
21
+ <td align=right valign=top width=300>
22
+ <a href="../../index.html">Back to hunt</a> | <a href="../index.html">Back to puzzle set</a>
23
+ </td></tr></table>
24
+
25
+ <blockquote><i>
26
+
27
+
28
+ "What if he looks up?" Dorothy whispered, pointing at the CP who
29
+ just wandered into Lobby 7.<p>
30
+
31
+ "They never look up," said Jack, taking advantage of an opening by
32
+ planting a vicious cherry bomb at Dorothy's feet. "You're out,
33
+ Dorothy." Dorothy sighed and got back in line.<p>
34
+
35
+ Once James took Dorothy's spot on the playing field, J. Arthur
36
+ stepped on
37
+ the court. "Hey!" he called out to the CP, "little help?"<p>
38
+
39
+ The CP chuckled at the simple game and moved on, never looking up,
40
+ never noticing Thomas and Sigmund high above as they hung a large
41
+ banner inside the Little Dome with the following two dozen phrases
42
+ scrawled on it...<p>
43
+
44
+ </i></blockquote>
45
+
46
+ <pre>
47
+ ACME rival
48
+ Creator of lightbulbs?
49
+ Custard
50
+ Even funnier than LOL :-)
51
+ Gray, for one
52
+ He did it, she did it
53
+ Jejuna followers
54
+ Judy Garland, for one
55
+ Kelsey's co-star
56
+ Loyal to the Scottish
57
+ Mimic
58
+ Protected
59
+ Rosalind, Margaret, or Kip
60
+ Seat of Malheur County
61
+ Senator's right hand
62
+ Separates a Man from his Mancha
63
+ She is in Spain?
64
+ Sheindlin's rival
65
+ Special group or band
66
+ Strumpet
67
+ Type of office
68
+ WGBH production
69
+ Wayne portrayer
70
+ Wicked
71
+
72
+ </pre>
73
+
74
+ </body><script type="module" src="/checkanswer.js"></script>
75
+ </html>
benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1_3_Puzzle.html/checkanswer.js ADDED
@@ -0,0 +1,281 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Do this first so that layout shift isn't too bad:
2
+ const container = document.createElement("div");
3
+ container.style = `
4
+ font-size: 16px;
5
+ font-size: clamp(16px, 2.4vw, 21px);
6
+ height: 2.5em;
7
+ `;
8
+ document.body.prepend(container);
9
+
10
+ import { React, html, css, render } from "./package.js";
11
+
12
+ /**
13
+ * Remove non-alphanumeric characters.
14
+ */
15
+ const normalizeAnswer = (answer) => {
16
+ if (getYear() === 2003) {
17
+ if (document.URL.includes("teamGuest/2")) {
18
+ // Special case: 2003 R2, whose answers are emoji.
19
+ return answer.trim();
20
+ } else if (document.URL.includes("6_3")) {
21
+ // Special case: Answer is literal Greek letter.
22
+ return answer.trim();
23
+ }
24
+ }
25
+ return answer.toUpperCase().replaceAll(/[^A-Z0-9]/g, "");
26
+ };
27
+
28
+ /**
29
+ * Returns the year of the hunt we're in.
30
+ */
31
+ const getYear = () => {
32
+ return Number(RegExp(`^.*/([0-9]{4})/.*$`).exec(document.URL)?.[1] ?? 0);
33
+ };
34
+
35
+ /**
36
+ * Fetches the answers as a list of {url, answer, prompt, intermediate}.
37
+ */
38
+ const getData = async () => {
39
+ const res = await fetch("/answers.tsv");
40
+ const data = await res.text();
41
+ const [header, ...body] = data.split("\n");
42
+ const headers = header.trim().split("\t");
43
+ return body.map((row) => {
44
+ const res = {};
45
+ row.split("\t").forEach((item, i) => {
46
+ res[headers[i]] = item.trim();
47
+ });
48
+ return res;
49
+ });
50
+ };
51
+
52
+ /**
53
+ * Gets the base URL; removes trailing index.html and .html, removes everything
54
+ * before the year, and then removes trailing slash.
55
+ */
56
+ const getBase = (url) => {
57
+ const root =
58
+ RegExp(`^(.*/)index.html`).exec(url)?.[1] ??
59
+ RegExp(`^(.*).html`).exec(url)?.[1] ??
60
+ url;
61
+ const base = RegExp(`^.*/([0-9]{4}/.*)$`).exec(root)?.[1] ?? root;
62
+ return base.endsWith("/") ? base.slice(0, -1) : base;
63
+ };
64
+
65
+ /**
66
+ * Get all rows in the data corresponding to a given URL. Group by same prompt.
67
+ */
68
+ const getAnswers = (data, url) => {
69
+ const base = getBase(url);
70
+ const rows = data.filter((row) => getBase(row.url) === base);
71
+ const prompts = [];
72
+ for (const row of rows) {
73
+ const { prompt } = row;
74
+ const group = prompts.find((group) => group.prompt === prompt);
75
+ if (group) {
76
+ group.rows.push(row);
77
+ } else {
78
+ prompts.push({ prompt, rows: [row] });
79
+ }
80
+ }
81
+ return prompts;
82
+ };
83
+
84
+ /**
85
+ * A single textbox and submit button in the rows of possible responses.
86
+ */
87
+ const ResponseRow = ({ prompt, rows, setFeedback }) => {
88
+ const [response, setResponse] = React.useState("");
89
+
90
+ const form = css`
91
+ align-items: baseline;
92
+ display: flex;
93
+ justify-content: right;
94
+ margin-bottom: 0.5em;
95
+
96
+ @media (max-width: 600px) {
97
+ align-items: flex-start;
98
+ flex-direction: column;
99
+ }
100
+ `;
101
+
102
+ const input = css`
103
+ background: #fafafa;
104
+ border: 1px solid #aaa;
105
+ border-radius: 2px;
106
+ color: #121212;
107
+ font-family: inherit;
108
+ font-size: 100%;
109
+ line-height: 1.2;
110
+ margin: 0 0.5em;
111
+ padding: 0.25em 0.5em;
112
+
113
+ @media (max-width: 600px) {
114
+ margin: 0 0 0.25em;
115
+ }
116
+ `;
117
+
118
+ const onSubmit = (e) => {
119
+ e.preventDefault();
120
+ let set = false;
121
+ for (const row of rows) {
122
+ const correct = normalizeAnswer(row.answer) === normalizeAnswer(response);
123
+ if (correct) {
124
+ setFeedback(
125
+ row.intermediate?.trim() === "TRUE"
126
+ ? "Correct! See the solution page for the answer."
127
+ : `Solved! The answer was ${row.answer}.`
128
+ );
129
+ set = true;
130
+ break;
131
+ }
132
+ }
133
+ if (!set) {
134
+ setFeedback("Incorrect.");
135
+ }
136
+ };
137
+
138
+ const onChange = (e) => setResponse(e.target.value);
139
+
140
+ return html`
141
+ <form class=${form} onSubmit=${onSubmit}>
142
+ <label htmlFor=${prompt + " prompt"}>
143
+ ${prompt || "Enter your guess"}:
144
+ </label>
145
+ <input
146
+ class=${input}
147
+ id=${prompt + " prompt"}
148
+ onChange=${onChange}
149
+ required
150
+ type="text"
151
+ value=${response}
152
+ />
153
+ <button type="submit">Submit</button>
154
+ </form>
155
+ `;
156
+ };
157
+
158
+ /**
159
+ * Check answer button, rendered at top of page.
160
+ */
161
+ const CheckButton = ({ prompts }) => {
162
+ const [open, setOpen] = React.useState(false);
163
+ const [feedback, setFeedback] = React.useState("Call in an answer.");
164
+
165
+ const wrapper = css`
166
+ font-family: "PT Sans", sans-serif;
167
+ font-size: 16px;
168
+ font-size: clamp(16px, 2.4vw, 21px);
169
+ height: 2.5em;
170
+
171
+ button {
172
+ background: #555;
173
+ border: none;
174
+ border-radius: 2px;
175
+ color: #fff;
176
+ cursor: pointer;
177
+ display: inline-block;
178
+ font-size: 1em;
179
+ font-family: "PT Sans", sans-serif;
180
+ font-weight: bold;
181
+ line-height: 1.2;
182
+ padding: 0.25em 1em;
183
+ text-align: center;
184
+ text-decoration: none;
185
+ text-transform: none;
186
+ }
187
+
188
+ p {
189
+ margin: 0 0 1em;
190
+ }
191
+
192
+ a {
193
+ color: inherit !important;
194
+ }
195
+ `;
196
+
197
+ const btnTop = [2015, 2016].includes(getYear())
198
+ ? "50px"
199
+ : [2012].includes(getYear())
200
+ ? "-2.5em"
201
+ : "0px";
202
+
203
+ const button = css`
204
+ box-sizing: border-box;
205
+ height: 2.5em;
206
+ left: 0;
207
+ position: absolute;
208
+ top: ${btnTop};
209
+ width: 100%;
210
+ z-index: 9999;
211
+ `;
212
+
213
+ const dropdownWrapper = css`
214
+ background: #edeff0;
215
+ color: #121212;
216
+ left: 0;
217
+ position: absolute;
218
+ right: 0;
219
+ top: calc(2.5em + ${btnTop});
220
+ z-index: 9999;
221
+ `;
222
+
223
+ const dropdown = css`
224
+ margin: 0 auto;
225
+ max-width: 40em;
226
+ padding: 1em;
227
+ z-index: 9999;
228
+ `;
229
+
230
+ const responses = css`
231
+ margin: 0 auto;
232
+ width: fit-content;
233
+
234
+ @media (max-width: 600px) {
235
+ width: auto;
236
+ }
237
+ `;
238
+
239
+ const onClick = () => setOpen(!open);
240
+
241
+ const body =
242
+ prompts.length > 0
243
+ ? prompts.map(
244
+ (group) =>
245
+ html`<${ResponseRow} setFeedback=${setFeedback} ...${group} />`
246
+ )
247
+ : html`<p>
248
+ No answers found on this page. Please report this to${" "}
249
+ <a href="mailto:puzzle@mit.edu">puzzle@mit.edu</a>.
250
+ </p>`;
251
+
252
+ return html`
253
+ <style>
254
+ @import url("https://fonts.googleapis.com/css2?family=PT+Sans:wght@400;700&display=swap");
255
+
256
+ ${[2015, 2016].includes(getYear()) &&
257
+ ".navbar-fixed-top { z-index: 10000 }"}
258
+ ${[2012].includes(getYear()) &&
259
+ "body { top: 2.5em } #check-answer, #shortcuts { z-index: 10000 !important }"}
260
+ ${[2006].includes(getYear()) && 'img[alt="Check Answer"] { display: none }'}
261
+ </style>
262
+ <div class=${wrapper}>
263
+ <button class=${button} onClick=${onClick}>
264
+ Check your answers spoiler-free
265
+ </button>
266
+ ${open &&
267
+ html`
268
+ <div class=${dropdownWrapper}>
269
+ <div class=${dropdown}>
270
+ <p>${feedback}</p>
271
+ <div class=${responses}>${body}</div>
272
+ </div>
273
+ </div>
274
+ `}
275
+ </div>
276
+ `;
277
+ };
278
+
279
+ const data = await getData();
280
+ const prompts = getAnswers(data, document.URL);
281
+ render(html`<${CheckButton} prompts=${prompts} />`, container);
benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1_3_Puzzle.html/index.html ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <HTML>
2
+ <HEAD>
3
+ <TITLE>Mystery Hunt 2000, Set 1</TITLE>
4
+ <LINK REV=owns HREF="mailto:puzzle@mit.edu">
5
+ </HEAD>
6
+
7
+ <BODY TEXT="#303030" BGCOLOR="#FFFFFF" LINK="#330066" ALINK="#000000"
8
+ VLINK="#000000">
9
+
10
+
11
+
12
+ <table width=100% border=0>
13
+ <tr><td align=left valign=top><h2>
14
+
15
+ <H3>Puzzles, Set 1</H3>
16
+
17
+ </h2></td>
18
+ <td align=right valign=top width=300>
19
+ <a href="../index.html">Back to hunt</a>
20
+ </td></tr></table>
21
+
22
+
23
+ <BLOCKQUOTE>
24
+ <A HREF="1/Puzzle.html">Puzzle 1</A> <A HREF="1/Solution.html">Solution 1</A><BR>
25
+ <A HREF="2/Puzzle.html">Puzzle 2</A> <A HREF="2/Solution.html">Solution 2</A><BR>
26
+ <A HREF="3/Puzzle.html">Puzzle 3</A> <A HREF="3/Solution.html">Solution 3</A><BR>
27
+ <A HREF="4/Puzzle.html">Puzzle 4</A> <A HREF="4/Solution.html">Solution 4</A><BR>
28
+ <A HREF="5/Puzzle.html">Puzzle 5</A> <A HREF="5/Solution.html">Solution 5</A><BR>
29
+ <A HREF="6/Puzzle.html">Puzzle 6</A> <A HREF="6/Solution.html">Solution 6</A><BR>
30
+ <A HREF="7/Puzzle.html">Puzzle 7</A> <A HREF="7/Solution.html">Solution 7</A><BR>
31
+ <A HREF="8/Puzzle.html">Puzzle 8</A> <A HREF="8/Solution.html">Solution 8</A><BR>
32
+ <A HREF="9/Puzzle.html">Puzzle 9</A> <A HREF="9/Solution.html">Solution 9</A><BR>
33
+ <A HREF="10/Puzzle.html">Puzzle 10</A> <A HREF="10/Solution.html">Solution 10</A><BR>
34
+ <A HREF="11/Puzzle.html">Puzzle 11</A> <A HREF="11/Solution.html">Solution 11</A><BR>
35
+ <BR>
36
+ <A HREF="../hints/hint1.txt">Hint</A> <A HREF="../hints/solution1.txt">Hint Solution</A><BR>
37
+ <A HREF="Meta/Solution.html">Metapuzzle Solution</A><BR>
38
+ </BLOCKQUOTE>
39
+ If you participated in the Hunt, please fill out the <A HREF="../survey.txt">survey</A>.
40
+
41
+ </BODY><script type="module" src="/checkanswer.js"></script>
42
+ </HTML>
benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1_4_Puzzle.html/Puzzle.html ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <html>
2
+
3
+ <head>
4
+ <title>
5
+
6
+
7
+ Mystery Hunt 2000, Puzzle 1.4
8
+
9
+ </title>
10
+ </head>
11
+
12
+ <body text=#303030 bgcolor=#ffffff link=#330066 alink=#000000 vlink=#000000>
13
+
14
+ <table width=100% border=0>
15
+ <tr><td align=left valign=top><h2>
16
+
17
+ 1.4: Winds of Confusion
18
+
19
+ </h2></td>
20
+ <td align=right valign=top width=300>
21
+ <a href="../../index.html">Back to hunt</a> | <a href="../index.html">Back to puzzle set</a>
22
+ </td></tr></table>
23
+
24
+ <blockquote><i>
25
+
26
+
27
+
28
+ <p>Whooooshhh!!!!! Suddenly an eerie but somehow heartening strong gust
29
+ of wind blew by Dorothy. Mussing up her skirt and making
30
+ her go into a tizzy, she had to sit down. After recovering, Dorothy
31
+ looked about and saw that the breeze brought the following on a piece of
32
+ paper.
33
+ </i></blockquote>
34
+
35
+ <br>&nbsp;
36
+ <br>&nbsp;
37
+ <blockquote>
38
+ <blockquote><img SRC="symbols.gif" height=42 width=252></blockquote>
39
+ </blockquote>
40
+
41
+ </body><script type="module" src="/checkanswer.js"></script>
42
+ </html>
benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1_4_Puzzle.html/checkanswer.js ADDED
@@ -0,0 +1,281 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Do this first so that layout shift isn't too bad:
2
+ const container = document.createElement("div");
3
+ container.style = `
4
+ font-size: 16px;
5
+ font-size: clamp(16px, 2.4vw, 21px);
6
+ height: 2.5em;
7
+ `;
8
+ document.body.prepend(container);
9
+
10
+ import { React, html, css, render } from "./package.js";
11
+
12
+ /**
13
+ * Remove non-alphanumeric characters.
14
+ */
15
+ const normalizeAnswer = (answer) => {
16
+ if (getYear() === 2003) {
17
+ if (document.URL.includes("teamGuest/2")) {
18
+ // Special case: 2003 R2, whose answers are emoji.
19
+ return answer.trim();
20
+ } else if (document.URL.includes("6_3")) {
21
+ // Special case: Answer is literal Greek letter.
22
+ return answer.trim();
23
+ }
24
+ }
25
+ return answer.toUpperCase().replaceAll(/[^A-Z0-9]/g, "");
26
+ };
27
+
28
+ /**
29
+ * Returns the year of the hunt we're in.
30
+ */
31
+ const getYear = () => {
32
+ return Number(RegExp(`^.*/([0-9]{4})/.*$`).exec(document.URL)?.[1] ?? 0);
33
+ };
34
+
35
+ /**
36
+ * Fetches the answers as a list of {url, answer, prompt, intermediate}.
37
+ */
38
+ const getData = async () => {
39
+ const res = await fetch("/answers.tsv");
40
+ const data = await res.text();
41
+ const [header, ...body] = data.split("\n");
42
+ const headers = header.trim().split("\t");
43
+ return body.map((row) => {
44
+ const res = {};
45
+ row.split("\t").forEach((item, i) => {
46
+ res[headers[i]] = item.trim();
47
+ });
48
+ return res;
49
+ });
50
+ };
51
+
52
+ /**
53
+ * Gets the base URL; removes trailing index.html and .html, removes everything
54
+ * before the year, and then removes trailing slash.
55
+ */
56
+ const getBase = (url) => {
57
+ const root =
58
+ RegExp(`^(.*/)index.html`).exec(url)?.[1] ??
59
+ RegExp(`^(.*).html`).exec(url)?.[1] ??
60
+ url;
61
+ const base = RegExp(`^.*/([0-9]{4}/.*)$`).exec(root)?.[1] ?? root;
62
+ return base.endsWith("/") ? base.slice(0, -1) : base;
63
+ };
64
+
65
+ /**
66
+ * Get all rows in the data corresponding to a given URL. Group by same prompt.
67
+ */
68
+ const getAnswers = (data, url) => {
69
+ const base = getBase(url);
70
+ const rows = data.filter((row) => getBase(row.url) === base);
71
+ const prompts = [];
72
+ for (const row of rows) {
73
+ const { prompt } = row;
74
+ const group = prompts.find((group) => group.prompt === prompt);
75
+ if (group) {
76
+ group.rows.push(row);
77
+ } else {
78
+ prompts.push({ prompt, rows: [row] });
79
+ }
80
+ }
81
+ return prompts;
82
+ };
83
+
84
+ /**
85
+ * A single textbox and submit button in the rows of possible responses.
86
+ */
87
+ const ResponseRow = ({ prompt, rows, setFeedback }) => {
88
+ const [response, setResponse] = React.useState("");
89
+
90
+ const form = css`
91
+ align-items: baseline;
92
+ display: flex;
93
+ justify-content: right;
94
+ margin-bottom: 0.5em;
95
+
96
+ @media (max-width: 600px) {
97
+ align-items: flex-start;
98
+ flex-direction: column;
99
+ }
100
+ `;
101
+
102
+ const input = css`
103
+ background: #fafafa;
104
+ border: 1px solid #aaa;
105
+ border-radius: 2px;
106
+ color: #121212;
107
+ font-family: inherit;
108
+ font-size: 100%;
109
+ line-height: 1.2;
110
+ margin: 0 0.5em;
111
+ padding: 0.25em 0.5em;
112
+
113
+ @media (max-width: 600px) {
114
+ margin: 0 0 0.25em;
115
+ }
116
+ `;
117
+
118
+ const onSubmit = (e) => {
119
+ e.preventDefault();
120
+ let set = false;
121
+ for (const row of rows) {
122
+ const correct = normalizeAnswer(row.answer) === normalizeAnswer(response);
123
+ if (correct) {
124
+ setFeedback(
125
+ row.intermediate?.trim() === "TRUE"
126
+ ? "Correct! See the solution page for the answer."
127
+ : `Solved! The answer was ${row.answer}.`
128
+ );
129
+ set = true;
130
+ break;
131
+ }
132
+ }
133
+ if (!set) {
134
+ setFeedback("Incorrect.");
135
+ }
136
+ };
137
+
138
+ const onChange = (e) => setResponse(e.target.value);
139
+
140
+ return html`
141
+ <form class=${form} onSubmit=${onSubmit}>
142
+ <label htmlFor=${prompt + " prompt"}>
143
+ ${prompt || "Enter your guess"}:
144
+ </label>
145
+ <input
146
+ class=${input}
147
+ id=${prompt + " prompt"}
148
+ onChange=${onChange}
149
+ required
150
+ type="text"
151
+ value=${response}
152
+ />
153
+ <button type="submit">Submit</button>
154
+ </form>
155
+ `;
156
+ };
157
+
158
+ /**
159
+ * Check answer button, rendered at top of page.
160
+ */
161
+ const CheckButton = ({ prompts }) => {
162
+ const [open, setOpen] = React.useState(false);
163
+ const [feedback, setFeedback] = React.useState("Call in an answer.");
164
+
165
+ const wrapper = css`
166
+ font-family: "PT Sans", sans-serif;
167
+ font-size: 16px;
168
+ font-size: clamp(16px, 2.4vw, 21px);
169
+ height: 2.5em;
170
+
171
+ button {
172
+ background: #555;
173
+ border: none;
174
+ border-radius: 2px;
175
+ color: #fff;
176
+ cursor: pointer;
177
+ display: inline-block;
178
+ font-size: 1em;
179
+ font-family: "PT Sans", sans-serif;
180
+ font-weight: bold;
181
+ line-height: 1.2;
182
+ padding: 0.25em 1em;
183
+ text-align: center;
184
+ text-decoration: none;
185
+ text-transform: none;
186
+ }
187
+
188
+ p {
189
+ margin: 0 0 1em;
190
+ }
191
+
192
+ a {
193
+ color: inherit !important;
194
+ }
195
+ `;
196
+
197
+ const btnTop = [2015, 2016].includes(getYear())
198
+ ? "50px"
199
+ : [2012].includes(getYear())
200
+ ? "-2.5em"
201
+ : "0px";
202
+
203
+ const button = css`
204
+ box-sizing: border-box;
205
+ height: 2.5em;
206
+ left: 0;
207
+ position: absolute;
208
+ top: ${btnTop};
209
+ width: 100%;
210
+ z-index: 9999;
211
+ `;
212
+
213
+ const dropdownWrapper = css`
214
+ background: #edeff0;
215
+ color: #121212;
216
+ left: 0;
217
+ position: absolute;
218
+ right: 0;
219
+ top: calc(2.5em + ${btnTop});
220
+ z-index: 9999;
221
+ `;
222
+
223
+ const dropdown = css`
224
+ margin: 0 auto;
225
+ max-width: 40em;
226
+ padding: 1em;
227
+ z-index: 9999;
228
+ `;
229
+
230
+ const responses = css`
231
+ margin: 0 auto;
232
+ width: fit-content;
233
+
234
+ @media (max-width: 600px) {
235
+ width: auto;
236
+ }
237
+ `;
238
+
239
+ const onClick = () => setOpen(!open);
240
+
241
+ const body =
242
+ prompts.length > 0
243
+ ? prompts.map(
244
+ (group) =>
245
+ html`<${ResponseRow} setFeedback=${setFeedback} ...${group} />`
246
+ )
247
+ : html`<p>
248
+ No answers found on this page. Please report this to${" "}
249
+ <a href="mailto:puzzle@mit.edu">puzzle@mit.edu</a>.
250
+ </p>`;
251
+
252
+ return html`
253
+ <style>
254
+ @import url("https://fonts.googleapis.com/css2?family=PT+Sans:wght@400;700&display=swap");
255
+
256
+ ${[2015, 2016].includes(getYear()) &&
257
+ ".navbar-fixed-top { z-index: 10000 }"}
258
+ ${[2012].includes(getYear()) &&
259
+ "body { top: 2.5em } #check-answer, #shortcuts { z-index: 10000 !important }"}
260
+ ${[2006].includes(getYear()) && 'img[alt="Check Answer"] { display: none }'}
261
+ </style>
262
+ <div class=${wrapper}>
263
+ <button class=${button} onClick=${onClick}>
264
+ Check your answers spoiler-free
265
+ </button>
266
+ ${open &&
267
+ html`
268
+ <div class=${dropdownWrapper}>
269
+ <div class=${dropdown}>
270
+ <p>${feedback}</p>
271
+ <div class=${responses}>${body}</div>
272
+ </div>
273
+ </div>
274
+ `}
275
+ </div>
276
+ `;
277
+ };
278
+
279
+ const data = await getData();
280
+ const prompts = getAnswers(data, document.URL);
281
+ render(html`<${CheckButton} prompts=${prompts} />`, container);
benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1_4_Puzzle.html/index.html ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <HTML>
2
+ <HEAD>
3
+ <TITLE>Mystery Hunt 2000, Set 1</TITLE>
4
+ <LINK REV=owns HREF="mailto:puzzle@mit.edu">
5
+ </HEAD>
6
+
7
+ <BODY TEXT="#303030" BGCOLOR="#FFFFFF" LINK="#330066" ALINK="#000000"
8
+ VLINK="#000000">
9
+
10
+
11
+
12
+ <table width=100% border=0>
13
+ <tr><td align=left valign=top><h2>
14
+
15
+ <H3>Puzzles, Set 1</H3>
16
+
17
+ </h2></td>
18
+ <td align=right valign=top width=300>
19
+ <a href="../index.html">Back to hunt</a>
20
+ </td></tr></table>
21
+
22
+
23
+ <BLOCKQUOTE>
24
+ <A HREF="1/Puzzle.html">Puzzle 1</A> <A HREF="1/Solution.html">Solution 1</A><BR>
25
+ <A HREF="2/Puzzle.html">Puzzle 2</A> <A HREF="2/Solution.html">Solution 2</A><BR>
26
+ <A HREF="3/Puzzle.html">Puzzle 3</A> <A HREF="3/Solution.html">Solution 3</A><BR>
27
+ <A HREF="4/Puzzle.html">Puzzle 4</A> <A HREF="4/Solution.html">Solution 4</A><BR>
28
+ <A HREF="5/Puzzle.html">Puzzle 5</A> <A HREF="5/Solution.html">Solution 5</A><BR>
29
+ <A HREF="6/Puzzle.html">Puzzle 6</A> <A HREF="6/Solution.html">Solution 6</A><BR>
30
+ <A HREF="7/Puzzle.html">Puzzle 7</A> <A HREF="7/Solution.html">Solution 7</A><BR>
31
+ <A HREF="8/Puzzle.html">Puzzle 8</A> <A HREF="8/Solution.html">Solution 8</A><BR>
32
+ <A HREF="9/Puzzle.html">Puzzle 9</A> <A HREF="9/Solution.html">Solution 9</A><BR>
33
+ <A HREF="10/Puzzle.html">Puzzle 10</A> <A HREF="10/Solution.html">Solution 10</A><BR>
34
+ <A HREF="11/Puzzle.html">Puzzle 11</A> <A HREF="11/Solution.html">Solution 11</A><BR>
35
+ <BR>
36
+ <A HREF="../hints/hint1.txt">Hint</A> <A HREF="../hints/solution1.txt">Hint Solution</A><BR>
37
+ <A HREF="Meta/Solution.html">Metapuzzle Solution</A><BR>
38
+ </BLOCKQUOTE>
39
+ If you participated in the Hunt, please fill out the <A HREF="../survey.txt">survey</A>.
40
+
41
+ </BODY><script type="module" src="/checkanswer.js"></script>
42
+ </HTML>
benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1_5_Puzzle.html/Puzzle.html ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <html>
2
+
3
+ <head>
4
+ <title>
5
+
6
+ Mystery Hunt 2000, Puzzle 1.5
7
+
8
+ </title>
9
+ </head>
10
+
11
+ <body text=#303030 bgcolor=#ffffff link=#330066 alink=#000000 vlink=#000000>
12
+
13
+ <table border=0 width=100%>
14
+ <tr><td align=left valign=top><h2>
15
+
16
+ 1.5: Battleships In Space!
17
+
18
+ </h2></td>
19
+ <td align=right valign=top width=300>
20
+ <a href="../../index.html">Back to hunt</a> | <a href="../index.html">Back to puzzle set</a>
21
+ </td></tr></table>
22
+
23
+ <blockquote><i>
24
+
25
+ "You know," a nervous, stammering fellow told Dorothy, "you're not
26
+ the only film character to ever attend MIT. I myself hail from MIT and
27
+ I was able to stave off an alien invasion with my trusty Powerbook!"
28
+
29
+ </i></blockquote>
30
+
31
+ <pre>
32
+
33
+ For centuries, aliens have been floating over our countryside, spying
34
+ intently on the letters beneath them, occasionally replacing one of
35
+ our letters with one of their insidious "crop-circle" hieroglyphics.
36
+ (Well, except for "Z"; they don't seem to be too interested in "Z".)
37
+
38
+ We now believe that they are readying their forces for an all-out
39
+ strike on several continents, devastating our way of writing and
40
+ confusing schoolchildren of all nations. Only by finding every hidden
41
+ ship and cracking their secret code will you be able to preserve our
42
+ precious alphabet!
43
+
44
+ A single 4x1x1 alien battleship, two 3x1x1 alien cruisers, three 2x1x1
45
+ alien destroyers, and four 1x1x1 alien surveillance pods are all
46
+ hiding out in each section of space below. Each segment of a ship
47
+ occupies a single cell. Ships do not touch each other, even
48
+ diagonally. The numbers along the back panels reveal the total number
49
+ of ship segments in each row.
50
+
51
+
52
+ | 0 1 0 0 4 | 1 0 1 1 1
53
+ 1 | 3 |
54
+ 1 | 1 |
55
+ 1 | 3 1 1 0 0 0 | 0 1 0 2 0
56
+ 1 1 | 0 0 |
57
+ 1 0 | 0 0 |
58
+ 1 | 0 1 0 1 0 0 | 1 2 0 1 0
59
+ 1 1 | 1 0 |
60
+ 2 1 | 2 1 |
61
+ 0 | 0 1 0 1 0 2 | 0 1 0 1 0
62
+ 0 0 | 0 0 |
63
+ 0 0 | 1 0 |
64
+ 0 | 2 1 2 0 1 0 | 3 1 1 0 2
65
+ 2 3 |_______________ 1 2 |_______________
66
+ 0 2 ,' 1 3 ,'
67
+ 0 ,' A B C D E 1 ,' A B C D E
68
+ 1 ,' F G H I J 0 ,' F G H I J
69
+ 0 ,' K L M N O 1 ,' K L M N O
70
+ ,' P Q R S T ,' P Q R S T
71
+ ' U V W X Y ' U V W X Y
72
+
73
+
74
+ | 1 2 1 1 0 | 3 1 0 1 1
75
+ 1 | 1 |
76
+ 0 | 0 |
77
+ 1 | 1 0 0 1 0 1 | 1 0 0 1 0
78
+ 0 1 | 0 1 |
79
+ 3 1 | 4 1 |
80
+ 0 | 2 2 0 1 0 0 | 4 0 0 1 0
81
+ 0 1 | 0 1 |
82
+ 0 0 | 0 0 |
83
+ 1 | 1 1 0 2 0 1 | 1 0 1 1 1
84
+ 1 2 | 2 4 |
85
+ 2 1 | 1 0 |
86
+ 1 | 0 2 1 0 1 0 | 0 2 0 1 0
87
+ 0 0 |_______________ 0 0 |_______________
88
+ 0 0 ,' 0 0 ,'
89
+ 1 ,' A B C D E 1 ,' A B C D E
90
+ 1 ,' F G H I J 2 ,' F G H I J
91
+ 2 ,' K L M N O 0 ,' K L M N O
92
+ ,' P Q R S T ,' P Q R S T
93
+ ' U V W X Y ' U V W X Y
94
+
95
+
96
+ | 0 1 0 1 2 | 0 2 0 4 0
97
+ 1 | 0 |
98
+ 0 | 1 |
99
+ 1 | 0 1 0 1 2 2 | 0 1 0 0 0
100
+ 0 1 | 1 0 |
101
+ 2 1 | 2 0 |
102
+ 1 | 1 0 1 1 2 1 | 2 1 0 1 0
103
+ 0 1 | 0 2 |
104
+ 1 0 | 0 1 |
105
+ 1 | 2 1 1 0 1 0 | 2 0 0 1 0
106
+ 0 2 | 0 0 |
107
+ 3 0 | 1 0 |
108
+ 1 | 0 0 2 0 0 1 | 3 0 1 1 1
109
+ 0 0 |_______________ 1 1 |_______________
110
+ 2 0 ,' 1 3 ,'
111
+ 0 ,' A B C D E 1 ,' A B C D E
112
+ 1 ,' F G H I J 0 ,' F G H I J
113
+ 1 ,' K L M N O 1 ,' K L M N O
114
+ ,' P Q R S T ,' P Q R S T
115
+ ' U V W X Y ' U V W X Y
116
+
117
+ </pre>
118
+
119
+ </body><script type="module" src="/checkanswer.js"></script>
120
+ </html>
benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1_5_Puzzle.html/checkanswer.js ADDED
@@ -0,0 +1,281 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Do this first so that layout shift isn't too bad:
2
+ const container = document.createElement("div");
3
+ container.style = `
4
+ font-size: 16px;
5
+ font-size: clamp(16px, 2.4vw, 21px);
6
+ height: 2.5em;
7
+ `;
8
+ document.body.prepend(container);
9
+
10
+ import { React, html, css, render } from "./package.js";
11
+
12
+ /**
13
+ * Remove non-alphanumeric characters.
14
+ */
15
+ const normalizeAnswer = (answer) => {
16
+ if (getYear() === 2003) {
17
+ if (document.URL.includes("teamGuest/2")) {
18
+ // Special case: 2003 R2, whose answers are emoji.
19
+ return answer.trim();
20
+ } else if (document.URL.includes("6_3")) {
21
+ // Special case: Answer is literal Greek letter.
22
+ return answer.trim();
23
+ }
24
+ }
25
+ return answer.toUpperCase().replaceAll(/[^A-Z0-9]/g, "");
26
+ };
27
+
28
+ /**
29
+ * Returns the year of the hunt we're in.
30
+ */
31
+ const getYear = () => {
32
+ return Number(RegExp(`^.*/([0-9]{4})/.*$`).exec(document.URL)?.[1] ?? 0);
33
+ };
34
+
35
+ /**
36
+ * Fetches the answers as a list of {url, answer, prompt, intermediate}.
37
+ */
38
+ const getData = async () => {
39
+ const res = await fetch("/answers.tsv");
40
+ const data = await res.text();
41
+ const [header, ...body] = data.split("\n");
42
+ const headers = header.trim().split("\t");
43
+ return body.map((row) => {
44
+ const res = {};
45
+ row.split("\t").forEach((item, i) => {
46
+ res[headers[i]] = item.trim();
47
+ });
48
+ return res;
49
+ });
50
+ };
51
+
52
+ /**
53
+ * Gets the base URL; removes trailing index.html and .html, removes everything
54
+ * before the year, and then removes trailing slash.
55
+ */
56
+ const getBase = (url) => {
57
+ const root =
58
+ RegExp(`^(.*/)index.html`).exec(url)?.[1] ??
59
+ RegExp(`^(.*).html`).exec(url)?.[1] ??
60
+ url;
61
+ const base = RegExp(`^.*/([0-9]{4}/.*)$`).exec(root)?.[1] ?? root;
62
+ return base.endsWith("/") ? base.slice(0, -1) : base;
63
+ };
64
+
65
+ /**
66
+ * Get all rows in the data corresponding to a given URL. Group by same prompt.
67
+ */
68
+ const getAnswers = (data, url) => {
69
+ const base = getBase(url);
70
+ const rows = data.filter((row) => getBase(row.url) === base);
71
+ const prompts = [];
72
+ for (const row of rows) {
73
+ const { prompt } = row;
74
+ const group = prompts.find((group) => group.prompt === prompt);
75
+ if (group) {
76
+ group.rows.push(row);
77
+ } else {
78
+ prompts.push({ prompt, rows: [row] });
79
+ }
80
+ }
81
+ return prompts;
82
+ };
83
+
84
+ /**
85
+ * A single textbox and submit button in the rows of possible responses.
86
+ */
87
+ const ResponseRow = ({ prompt, rows, setFeedback }) => {
88
+ const [response, setResponse] = React.useState("");
89
+
90
+ const form = css`
91
+ align-items: baseline;
92
+ display: flex;
93
+ justify-content: right;
94
+ margin-bottom: 0.5em;
95
+
96
+ @media (max-width: 600px) {
97
+ align-items: flex-start;
98
+ flex-direction: column;
99
+ }
100
+ `;
101
+
102
+ const input = css`
103
+ background: #fafafa;
104
+ border: 1px solid #aaa;
105
+ border-radius: 2px;
106
+ color: #121212;
107
+ font-family: inherit;
108
+ font-size: 100%;
109
+ line-height: 1.2;
110
+ margin: 0 0.5em;
111
+ padding: 0.25em 0.5em;
112
+
113
+ @media (max-width: 600px) {
114
+ margin: 0 0 0.25em;
115
+ }
116
+ `;
117
+
118
+ const onSubmit = (e) => {
119
+ e.preventDefault();
120
+ let set = false;
121
+ for (const row of rows) {
122
+ const correct = normalizeAnswer(row.answer) === normalizeAnswer(response);
123
+ if (correct) {
124
+ setFeedback(
125
+ row.intermediate?.trim() === "TRUE"
126
+ ? "Correct! See the solution page for the answer."
127
+ : `Solved! The answer was ${row.answer}.`
128
+ );
129
+ set = true;
130
+ break;
131
+ }
132
+ }
133
+ if (!set) {
134
+ setFeedback("Incorrect.");
135
+ }
136
+ };
137
+
138
+ const onChange = (e) => setResponse(e.target.value);
139
+
140
+ return html`
141
+ <form class=${form} onSubmit=${onSubmit}>
142
+ <label htmlFor=${prompt + " prompt"}>
143
+ ${prompt || "Enter your guess"}:
144
+ </label>
145
+ <input
146
+ class=${input}
147
+ id=${prompt + " prompt"}
148
+ onChange=${onChange}
149
+ required
150
+ type="text"
151
+ value=${response}
152
+ />
153
+ <button type="submit">Submit</button>
154
+ </form>
155
+ `;
156
+ };
157
+
158
+ /**
159
+ * Check answer button, rendered at top of page.
160
+ */
161
+ const CheckButton = ({ prompts }) => {
162
+ const [open, setOpen] = React.useState(false);
163
+ const [feedback, setFeedback] = React.useState("Call in an answer.");
164
+
165
+ const wrapper = css`
166
+ font-family: "PT Sans", sans-serif;
167
+ font-size: 16px;
168
+ font-size: clamp(16px, 2.4vw, 21px);
169
+ height: 2.5em;
170
+
171
+ button {
172
+ background: #555;
173
+ border: none;
174
+ border-radius: 2px;
175
+ color: #fff;
176
+ cursor: pointer;
177
+ display: inline-block;
178
+ font-size: 1em;
179
+ font-family: "PT Sans", sans-serif;
180
+ font-weight: bold;
181
+ line-height: 1.2;
182
+ padding: 0.25em 1em;
183
+ text-align: center;
184
+ text-decoration: none;
185
+ text-transform: none;
186
+ }
187
+
188
+ p {
189
+ margin: 0 0 1em;
190
+ }
191
+
192
+ a {
193
+ color: inherit !important;
194
+ }
195
+ `;
196
+
197
+ const btnTop = [2015, 2016].includes(getYear())
198
+ ? "50px"
199
+ : [2012].includes(getYear())
200
+ ? "-2.5em"
201
+ : "0px";
202
+
203
+ const button = css`
204
+ box-sizing: border-box;
205
+ height: 2.5em;
206
+ left: 0;
207
+ position: absolute;
208
+ top: ${btnTop};
209
+ width: 100%;
210
+ z-index: 9999;
211
+ `;
212
+
213
+ const dropdownWrapper = css`
214
+ background: #edeff0;
215
+ color: #121212;
216
+ left: 0;
217
+ position: absolute;
218
+ right: 0;
219
+ top: calc(2.5em + ${btnTop});
220
+ z-index: 9999;
221
+ `;
222
+
223
+ const dropdown = css`
224
+ margin: 0 auto;
225
+ max-width: 40em;
226
+ padding: 1em;
227
+ z-index: 9999;
228
+ `;
229
+
230
+ const responses = css`
231
+ margin: 0 auto;
232
+ width: fit-content;
233
+
234
+ @media (max-width: 600px) {
235
+ width: auto;
236
+ }
237
+ `;
238
+
239
+ const onClick = () => setOpen(!open);
240
+
241
+ const body =
242
+ prompts.length > 0
243
+ ? prompts.map(
244
+ (group) =>
245
+ html`<${ResponseRow} setFeedback=${setFeedback} ...${group} />`
246
+ )
247
+ : html`<p>
248
+ No answers found on this page. Please report this to${" "}
249
+ <a href="mailto:puzzle@mit.edu">puzzle@mit.edu</a>.
250
+ </p>`;
251
+
252
+ return html`
253
+ <style>
254
+ @import url("https://fonts.googleapis.com/css2?family=PT+Sans:wght@400;700&display=swap");
255
+
256
+ ${[2015, 2016].includes(getYear()) &&
257
+ ".navbar-fixed-top { z-index: 10000 }"}
258
+ ${[2012].includes(getYear()) &&
259
+ "body { top: 2.5em } #check-answer, #shortcuts { z-index: 10000 !important }"}
260
+ ${[2006].includes(getYear()) && 'img[alt="Check Answer"] { display: none }'}
261
+ </style>
262
+ <div class=${wrapper}>
263
+ <button class=${button} onClick=${onClick}>
264
+ Check your answers spoiler-free
265
+ </button>
266
+ ${open &&
267
+ html`
268
+ <div class=${dropdownWrapper}>
269
+ <div class=${dropdown}>
270
+ <p>${feedback}</p>
271
+ <div class=${responses}>${body}</div>
272
+ </div>
273
+ </div>
274
+ `}
275
+ </div>
276
+ `;
277
+ };
278
+
279
+ const data = await getData();
280
+ const prompts = getAnswers(data, document.URL);
281
+ render(html`<${CheckButton} prompts=${prompts} />`, container);
benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1_5_Puzzle.html/index.html ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <HTML>
2
+ <HEAD>
3
+ <TITLE>Mystery Hunt 2000, Set 1</TITLE>
4
+ <LINK REV=owns HREF="mailto:puzzle@mit.edu">
5
+ </HEAD>
6
+
7
+ <BODY TEXT="#303030" BGCOLOR="#FFFFFF" LINK="#330066" ALINK="#000000"
8
+ VLINK="#000000">
9
+
10
+
11
+
12
+ <table width=100% border=0>
13
+ <tr><td align=left valign=top><h2>
14
+
15
+ <H3>Puzzles, Set 1</H3>
16
+
17
+ </h2></td>
18
+ <td align=right valign=top width=300>
19
+ <a href="../index.html">Back to hunt</a>
20
+ </td></tr></table>
21
+
22
+
23
+ <BLOCKQUOTE>
24
+ <A HREF="1/Puzzle.html">Puzzle 1</A> <A HREF="1/Solution.html">Solution 1</A><BR>
25
+ <A HREF="2/Puzzle.html">Puzzle 2</A> <A HREF="2/Solution.html">Solution 2</A><BR>
26
+ <A HREF="3/Puzzle.html">Puzzle 3</A> <A HREF="3/Solution.html">Solution 3</A><BR>
27
+ <A HREF="4/Puzzle.html">Puzzle 4</A> <A HREF="4/Solution.html">Solution 4</A><BR>
28
+ <A HREF="5/Puzzle.html">Puzzle 5</A> <A HREF="5/Solution.html">Solution 5</A><BR>
29
+ <A HREF="6/Puzzle.html">Puzzle 6</A> <A HREF="6/Solution.html">Solution 6</A><BR>
30
+ <A HREF="7/Puzzle.html">Puzzle 7</A> <A HREF="7/Solution.html">Solution 7</A><BR>
31
+ <A HREF="8/Puzzle.html">Puzzle 8</A> <A HREF="8/Solution.html">Solution 8</A><BR>
32
+ <A HREF="9/Puzzle.html">Puzzle 9</A> <A HREF="9/Solution.html">Solution 9</A><BR>
33
+ <A HREF="10/Puzzle.html">Puzzle 10</A> <A HREF="10/Solution.html">Solution 10</A><BR>
34
+ <A HREF="11/Puzzle.html">Puzzle 11</A> <A HREF="11/Solution.html">Solution 11</A><BR>
35
+ <BR>
36
+ <A HREF="../hints/hint1.txt">Hint</A> <A HREF="../hints/solution1.txt">Hint Solution</A><BR>
37
+ <A HREF="Meta/Solution.html">Metapuzzle Solution</A><BR>
38
+ </BLOCKQUOTE>
39
+ If you participated in the Hunt, please fill out the <A HREF="../survey.txt">survey</A>.
40
+
41
+ </BODY><script type="module" src="/checkanswer.js"></script>
42
+ </HTML>
benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1_6_Puzzle.html/Puzzle.html ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <html>
2
+
3
+ <head>
4
+ <title>
5
+
6
+
7
+ Mystery Hunt 2000, Puzzle 1.6
8
+
9
+ </title>
10
+ </head>
11
+
12
+ <body text=#303030 bgcolor=#ffffff link=#330066 alink=#000000 vlink=#000000>
13
+
14
+ <table width=100% border=0>
15
+ <tr><td align=left valign=top><h2>
16
+
17
+ <!-- XXX Edit this part here -->
18
+ 1.6: Secular Fun with Pentagrams
19
+
20
+ </h2></td>
21
+ <td align=right valign=top width=300>
22
+ <a href="../../index.html">Back to hunt</a> | <a href="../index.html">Back to puzzle set</a>
23
+ </td></tr></table>
24
+
25
+ <blockquote><i>
26
+
27
+ <!-- XXX Edit this part here -->
28
+ Strolling confusedly through the buildings of MIT, Dorothy found
29
+ herself in Building 5, staring at a wall which had "IHTFP" spray
30
+ painted on the wall in large red letters. "How strange..." she thought
31
+ out loud, and was answered by a student who popped his head out of a
32
+ door. "Not at all, really. This is building five. We loooove things
33
+ that come in fives! Especially groups of five letters! Just take a look
34
+ at our motto!" He gestured toward an inscription along the ceiling.
35
+ Dorothy looked at it and frowned, more confused than ever.
36
+
37
+ </i></blockquote>
38
+
39
+ <pre>
40
+
41
+ CODDD NAANA PEBNB FEBDC RGGRE PEPEG IKIII ODODD SAKTA ACCHC SDFHD DDODD
42
+ OCKMC JAPAA ONNOO TTOPP EPPPP ANMNM OLPNM EHEFI NMNMN UWCXC TTTTP SBBTS
43
+ KRRRT RUQTS
44
+
45
+ </pre>
46
+
47
+ </body><script type="module" src="/checkanswer.js"></script>
48
+ </html>
benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1_6_Puzzle.html/checkanswer.js ADDED
@@ -0,0 +1,281 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Do this first so that layout shift isn't too bad:
2
+ const container = document.createElement("div");
3
+ container.style = `
4
+ font-size: 16px;
5
+ font-size: clamp(16px, 2.4vw, 21px);
6
+ height: 2.5em;
7
+ `;
8
+ document.body.prepend(container);
9
+
10
+ import { React, html, css, render } from "./package.js";
11
+
12
+ /**
13
+ * Remove non-alphanumeric characters.
14
+ */
15
+ const normalizeAnswer = (answer) => {
16
+ if (getYear() === 2003) {
17
+ if (document.URL.includes("teamGuest/2")) {
18
+ // Special case: 2003 R2, whose answers are emoji.
19
+ return answer.trim();
20
+ } else if (document.URL.includes("6_3")) {
21
+ // Special case: Answer is literal Greek letter.
22
+ return answer.trim();
23
+ }
24
+ }
25
+ return answer.toUpperCase().replaceAll(/[^A-Z0-9]/g, "");
26
+ };
27
+
28
+ /**
29
+ * Returns the year of the hunt we're in.
30
+ */
31
+ const getYear = () => {
32
+ return Number(RegExp(`^.*/([0-9]{4})/.*$`).exec(document.URL)?.[1] ?? 0);
33
+ };
34
+
35
+ /**
36
+ * Fetches the answers as a list of {url, answer, prompt, intermediate}.
37
+ */
38
+ const getData = async () => {
39
+ const res = await fetch("/answers.tsv");
40
+ const data = await res.text();
41
+ const [header, ...body] = data.split("\n");
42
+ const headers = header.trim().split("\t");
43
+ return body.map((row) => {
44
+ const res = {};
45
+ row.split("\t").forEach((item, i) => {
46
+ res[headers[i]] = item.trim();
47
+ });
48
+ return res;
49
+ });
50
+ };
51
+
52
+ /**
53
+ * Gets the base URL; removes trailing index.html and .html, removes everything
54
+ * before the year, and then removes trailing slash.
55
+ */
56
+ const getBase = (url) => {
57
+ const root =
58
+ RegExp(`^(.*/)index.html`).exec(url)?.[1] ??
59
+ RegExp(`^(.*).html`).exec(url)?.[1] ??
60
+ url;
61
+ const base = RegExp(`^.*/([0-9]{4}/.*)$`).exec(root)?.[1] ?? root;
62
+ return base.endsWith("/") ? base.slice(0, -1) : base;
63
+ };
64
+
65
+ /**
66
+ * Get all rows in the data corresponding to a given URL. Group by same prompt.
67
+ */
68
+ const getAnswers = (data, url) => {
69
+ const base = getBase(url);
70
+ const rows = data.filter((row) => getBase(row.url) === base);
71
+ const prompts = [];
72
+ for (const row of rows) {
73
+ const { prompt } = row;
74
+ const group = prompts.find((group) => group.prompt === prompt);
75
+ if (group) {
76
+ group.rows.push(row);
77
+ } else {
78
+ prompts.push({ prompt, rows: [row] });
79
+ }
80
+ }
81
+ return prompts;
82
+ };
83
+
84
+ /**
85
+ * A single textbox and submit button in the rows of possible responses.
86
+ */
87
+ const ResponseRow = ({ prompt, rows, setFeedback }) => {
88
+ const [response, setResponse] = React.useState("");
89
+
90
+ const form = css`
91
+ align-items: baseline;
92
+ display: flex;
93
+ justify-content: right;
94
+ margin-bottom: 0.5em;
95
+
96
+ @media (max-width: 600px) {
97
+ align-items: flex-start;
98
+ flex-direction: column;
99
+ }
100
+ `;
101
+
102
+ const input = css`
103
+ background: #fafafa;
104
+ border: 1px solid #aaa;
105
+ border-radius: 2px;
106
+ color: #121212;
107
+ font-family: inherit;
108
+ font-size: 100%;
109
+ line-height: 1.2;
110
+ margin: 0 0.5em;
111
+ padding: 0.25em 0.5em;
112
+
113
+ @media (max-width: 600px) {
114
+ margin: 0 0 0.25em;
115
+ }
116
+ `;
117
+
118
+ const onSubmit = (e) => {
119
+ e.preventDefault();
120
+ let set = false;
121
+ for (const row of rows) {
122
+ const correct = normalizeAnswer(row.answer) === normalizeAnswer(response);
123
+ if (correct) {
124
+ setFeedback(
125
+ row.intermediate?.trim() === "TRUE"
126
+ ? "Correct! See the solution page for the answer."
127
+ : `Solved! The answer was ${row.answer}.`
128
+ );
129
+ set = true;
130
+ break;
131
+ }
132
+ }
133
+ if (!set) {
134
+ setFeedback("Incorrect.");
135
+ }
136
+ };
137
+
138
+ const onChange = (e) => setResponse(e.target.value);
139
+
140
+ return html`
141
+ <form class=${form} onSubmit=${onSubmit}>
142
+ <label htmlFor=${prompt + " prompt"}>
143
+ ${prompt || "Enter your guess"}:
144
+ </label>
145
+ <input
146
+ class=${input}
147
+ id=${prompt + " prompt"}
148
+ onChange=${onChange}
149
+ required
150
+ type="text"
151
+ value=${response}
152
+ />
153
+ <button type="submit">Submit</button>
154
+ </form>
155
+ `;
156
+ };
157
+
158
+ /**
159
+ * Check answer button, rendered at top of page.
160
+ */
161
+ const CheckButton = ({ prompts }) => {
162
+ const [open, setOpen] = React.useState(false);
163
+ const [feedback, setFeedback] = React.useState("Call in an answer.");
164
+
165
+ const wrapper = css`
166
+ font-family: "PT Sans", sans-serif;
167
+ font-size: 16px;
168
+ font-size: clamp(16px, 2.4vw, 21px);
169
+ height: 2.5em;
170
+
171
+ button {
172
+ background: #555;
173
+ border: none;
174
+ border-radius: 2px;
175
+ color: #fff;
176
+ cursor: pointer;
177
+ display: inline-block;
178
+ font-size: 1em;
179
+ font-family: "PT Sans", sans-serif;
180
+ font-weight: bold;
181
+ line-height: 1.2;
182
+ padding: 0.25em 1em;
183
+ text-align: center;
184
+ text-decoration: none;
185
+ text-transform: none;
186
+ }
187
+
188
+ p {
189
+ margin: 0 0 1em;
190
+ }
191
+
192
+ a {
193
+ color: inherit !important;
194
+ }
195
+ `;
196
+
197
+ const btnTop = [2015, 2016].includes(getYear())
198
+ ? "50px"
199
+ : [2012].includes(getYear())
200
+ ? "-2.5em"
201
+ : "0px";
202
+
203
+ const button = css`
204
+ box-sizing: border-box;
205
+ height: 2.5em;
206
+ left: 0;
207
+ position: absolute;
208
+ top: ${btnTop};
209
+ width: 100%;
210
+ z-index: 9999;
211
+ `;
212
+
213
+ const dropdownWrapper = css`
214
+ background: #edeff0;
215
+ color: #121212;
216
+ left: 0;
217
+ position: absolute;
218
+ right: 0;
219
+ top: calc(2.5em + ${btnTop});
220
+ z-index: 9999;
221
+ `;
222
+
223
+ const dropdown = css`
224
+ margin: 0 auto;
225
+ max-width: 40em;
226
+ padding: 1em;
227
+ z-index: 9999;
228
+ `;
229
+
230
+ const responses = css`
231
+ margin: 0 auto;
232
+ width: fit-content;
233
+
234
+ @media (max-width: 600px) {
235
+ width: auto;
236
+ }
237
+ `;
238
+
239
+ const onClick = () => setOpen(!open);
240
+
241
+ const body =
242
+ prompts.length > 0
243
+ ? prompts.map(
244
+ (group) =>
245
+ html`<${ResponseRow} setFeedback=${setFeedback} ...${group} />`
246
+ )
247
+ : html`<p>
248
+ No answers found on this page. Please report this to${" "}
249
+ <a href="mailto:puzzle@mit.edu">puzzle@mit.edu</a>.
250
+ </p>`;
251
+
252
+ return html`
253
+ <style>
254
+ @import url("https://fonts.googleapis.com/css2?family=PT+Sans:wght@400;700&display=swap");
255
+
256
+ ${[2015, 2016].includes(getYear()) &&
257
+ ".navbar-fixed-top { z-index: 10000 }"}
258
+ ${[2012].includes(getYear()) &&
259
+ "body { top: 2.5em } #check-answer, #shortcuts { z-index: 10000 !important }"}
260
+ ${[2006].includes(getYear()) && 'img[alt="Check Answer"] { display: none }'}
261
+ </style>
262
+ <div class=${wrapper}>
263
+ <button class=${button} onClick=${onClick}>
264
+ Check your answers spoiler-free
265
+ </button>
266
+ ${open &&
267
+ html`
268
+ <div class=${dropdownWrapper}>
269
+ <div class=${dropdown}>
270
+ <p>${feedback}</p>
271
+ <div class=${responses}>${body}</div>
272
+ </div>
273
+ </div>
274
+ `}
275
+ </div>
276
+ `;
277
+ };
278
+
279
+ const data = await getData();
280
+ const prompts = getAnswers(data, document.URL);
281
+ render(html`<${CheckButton} prompts=${prompts} />`, container);
benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1_6_Puzzle.html/index.html ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <HTML>
2
+ <HEAD>
3
+ <TITLE>Mystery Hunt 2000, Set 1</TITLE>
4
+ <LINK REV=owns HREF="mailto:puzzle@mit.edu">
5
+ </HEAD>
6
+
7
+ <BODY TEXT="#303030" BGCOLOR="#FFFFFF" LINK="#330066" ALINK="#000000"
8
+ VLINK="#000000">
9
+
10
+
11
+
12
+ <table width=100% border=0>
13
+ <tr><td align=left valign=top><h2>
14
+
15
+ <H3>Puzzles, Set 1</H3>
16
+
17
+ </h2></td>
18
+ <td align=right valign=top width=300>
19
+ <a href="../index.html">Back to hunt</a>
20
+ </td></tr></table>
21
+
22
+
23
+ <BLOCKQUOTE>
24
+ <A HREF="1/Puzzle.html">Puzzle 1</A> <A HREF="1/Solution.html">Solution 1</A><BR>
25
+ <A HREF="2/Puzzle.html">Puzzle 2</A> <A HREF="2/Solution.html">Solution 2</A><BR>
26
+ <A HREF="3/Puzzle.html">Puzzle 3</A> <A HREF="3/Solution.html">Solution 3</A><BR>
27
+ <A HREF="4/Puzzle.html">Puzzle 4</A> <A HREF="4/Solution.html">Solution 4</A><BR>
28
+ <A HREF="5/Puzzle.html">Puzzle 5</A> <A HREF="5/Solution.html">Solution 5</A><BR>
29
+ <A HREF="6/Puzzle.html">Puzzle 6</A> <A HREF="6/Solution.html">Solution 6</A><BR>
30
+ <A HREF="7/Puzzle.html">Puzzle 7</A> <A HREF="7/Solution.html">Solution 7</A><BR>
31
+ <A HREF="8/Puzzle.html">Puzzle 8</A> <A HREF="8/Solution.html">Solution 8</A><BR>
32
+ <A HREF="9/Puzzle.html">Puzzle 9</A> <A HREF="9/Solution.html">Solution 9</A><BR>
33
+ <A HREF="10/Puzzle.html">Puzzle 10</A> <A HREF="10/Solution.html">Solution 10</A><BR>
34
+ <A HREF="11/Puzzle.html">Puzzle 11</A> <A HREF="11/Solution.html">Solution 11</A><BR>
35
+ <BR>
36
+ <A HREF="../hints/hint1.txt">Hint</A> <A HREF="../hints/solution1.txt">Hint Solution</A><BR>
37
+ <A HREF="Meta/Solution.html">Metapuzzle Solution</A><BR>
38
+ </BLOCKQUOTE>
39
+ If you participated in the Hunt, please fill out the <A HREF="../survey.txt">survey</A>.
40
+
41
+ </BODY><script type="module" src="/checkanswer.js"></script>
42
+ </HTML>
benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1_7_Puzzle.html/Puzzle.html ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <html>
2
+
3
+ <head>
4
+ <title>
5
+
6
+ Mystery Hunt 2000, Puzzle 1.7
7
+
8
+ </title>
9
+ </head>
10
+
11
+ <body text=#303030 bgcolor=#ffffff link=#330066 alink=#000000 vlink=#000000>
12
+
13
+ <table border=0 width=100%>
14
+ <tr><td align=left valign=top><h2>
15
+
16
+ 1.7: Mumbo-Jumbo
17
+
18
+ </h2></td>
19
+ <td align=right valign=top width=300>
20
+ <a href="../../index.html">Back to hunt</a> | <a href="../index.html">Back to puzzle set</a>
21
+ </td></tr></table>
22
+
23
+ <blockquote><i>
24
+
25
+ Dorothy and the Lion sat in the back of the lecture hall, while the professor gesticulated
26
+ wildly and spoke incomprehensibly. "Impressive, isn't it?" whispered Dorothy.<P>
27
+
28
+ "Not in the slightest," replied the Lion. "That professor may use a lot of big mumbo-jumbo
29
+ words, but I hear he's just a big phony."
30
+
31
+ </i></blockquote>
32
+
33
+ <pre>
34
+
35
+ Larry Appleton:
36
+ ,---. ,---. ,---. ,---. ,---.
37
+ | | | | | | | | | |
38
+ | 3| | 4| | 3| | 1| | |
39
+ `---' `---' `---' `---' `---'
40
+
41
+ Bart Simpson:
42
+ ,---. ,---. ,---. ,---. ,---. ,---. ,---.
43
+ | | | | | | | | | | | | | |
44
+ | 5| | 4| | 4| | 8| | | | 3| | 1|
45
+ `---' `---' `---' `---' `---' `---' `---'
46
+
47
+ Paul Buchman:
48
+ ,---. ,---. ,---. ,---.
49
+ | | | | | | | |
50
+ | 4| | 1| | 1| | |
51
+ `---' `---' `---' `---'
52
+
53
+ Helen Seinfeld:
54
+ ,---. ,---. ,---. ,---. ,---.
55
+ | | | | | | | | | |
56
+ | 10| | 1| | 1| | | | 1|
57
+ `---' `---' `---' `---' `---'
58
+
59
+ Cat:
60
+ ,---. ,---. ,---. ,---. ,---. ,---. ,---.
61
+ | | | | | | | | | | | | | |
62
+ | 8| | | | 10| | 8| | 4| | 10| | 5|
63
+ `---' `---' `---' `---' `---' `---' `---'
64
+
65
+ Jack McFarland:
66
+ ,---. ,---. ,---. ,---. ,---. ,---.
67
+ | | | | | | | | | | | |
68
+ | 1| | 3| | | | 1| | 3| | 3|
69
+ `---' `---' `---' `---' `---' `---'
70
+
71
+ </pre>
72
+
73
+ </body><script type="module" src="/checkanswer.js"></script>
74
+ </html>
benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1_7_Puzzle.html/checkanswer.js ADDED
@@ -0,0 +1,281 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Do this first so that layout shift isn't too bad:
2
+ const container = document.createElement("div");
3
+ container.style = `
4
+ font-size: 16px;
5
+ font-size: clamp(16px, 2.4vw, 21px);
6
+ height: 2.5em;
7
+ `;
8
+ document.body.prepend(container);
9
+
10
+ import { React, html, css, render } from "./package.js";
11
+
12
+ /**
13
+ * Remove non-alphanumeric characters.
14
+ */
15
+ const normalizeAnswer = (answer) => {
16
+ if (getYear() === 2003) {
17
+ if (document.URL.includes("teamGuest/2")) {
18
+ // Special case: 2003 R2, whose answers are emoji.
19
+ return answer.trim();
20
+ } else if (document.URL.includes("6_3")) {
21
+ // Special case: Answer is literal Greek letter.
22
+ return answer.trim();
23
+ }
24
+ }
25
+ return answer.toUpperCase().replaceAll(/[^A-Z0-9]/g, "");
26
+ };
27
+
28
+ /**
29
+ * Returns the year of the hunt we're in.
30
+ */
31
+ const getYear = () => {
32
+ return Number(RegExp(`^.*/([0-9]{4})/.*$`).exec(document.URL)?.[1] ?? 0);
33
+ };
34
+
35
+ /**
36
+ * Fetches the answers as a list of {url, answer, prompt, intermediate}.
37
+ */
38
+ const getData = async () => {
39
+ const res = await fetch("/answers.tsv");
40
+ const data = await res.text();
41
+ const [header, ...body] = data.split("\n");
42
+ const headers = header.trim().split("\t");
43
+ return body.map((row) => {
44
+ const res = {};
45
+ row.split("\t").forEach((item, i) => {
46
+ res[headers[i]] = item.trim();
47
+ });
48
+ return res;
49
+ });
50
+ };
51
+
52
+ /**
53
+ * Gets the base URL; removes trailing index.html and .html, removes everything
54
+ * before the year, and then removes trailing slash.
55
+ */
56
+ const getBase = (url) => {
57
+ const root =
58
+ RegExp(`^(.*/)index.html`).exec(url)?.[1] ??
59
+ RegExp(`^(.*).html`).exec(url)?.[1] ??
60
+ url;
61
+ const base = RegExp(`^.*/([0-9]{4}/.*)$`).exec(root)?.[1] ?? root;
62
+ return base.endsWith("/") ? base.slice(0, -1) : base;
63
+ };
64
+
65
+ /**
66
+ * Get all rows in the data corresponding to a given URL. Group by same prompt.
67
+ */
68
+ const getAnswers = (data, url) => {
69
+ const base = getBase(url);
70
+ const rows = data.filter((row) => getBase(row.url) === base);
71
+ const prompts = [];
72
+ for (const row of rows) {
73
+ const { prompt } = row;
74
+ const group = prompts.find((group) => group.prompt === prompt);
75
+ if (group) {
76
+ group.rows.push(row);
77
+ } else {
78
+ prompts.push({ prompt, rows: [row] });
79
+ }
80
+ }
81
+ return prompts;
82
+ };
83
+
84
+ /**
85
+ * A single textbox and submit button in the rows of possible responses.
86
+ */
87
+ const ResponseRow = ({ prompt, rows, setFeedback }) => {
88
+ const [response, setResponse] = React.useState("");
89
+
90
+ const form = css`
91
+ align-items: baseline;
92
+ display: flex;
93
+ justify-content: right;
94
+ margin-bottom: 0.5em;
95
+
96
+ @media (max-width: 600px) {
97
+ align-items: flex-start;
98
+ flex-direction: column;
99
+ }
100
+ `;
101
+
102
+ const input = css`
103
+ background: #fafafa;
104
+ border: 1px solid #aaa;
105
+ border-radius: 2px;
106
+ color: #121212;
107
+ font-family: inherit;
108
+ font-size: 100%;
109
+ line-height: 1.2;
110
+ margin: 0 0.5em;
111
+ padding: 0.25em 0.5em;
112
+
113
+ @media (max-width: 600px) {
114
+ margin: 0 0 0.25em;
115
+ }
116
+ `;
117
+
118
+ const onSubmit = (e) => {
119
+ e.preventDefault();
120
+ let set = false;
121
+ for (const row of rows) {
122
+ const correct = normalizeAnswer(row.answer) === normalizeAnswer(response);
123
+ if (correct) {
124
+ setFeedback(
125
+ row.intermediate?.trim() === "TRUE"
126
+ ? "Correct! See the solution page for the answer."
127
+ : `Solved! The answer was ${row.answer}.`
128
+ );
129
+ set = true;
130
+ break;
131
+ }
132
+ }
133
+ if (!set) {
134
+ setFeedback("Incorrect.");
135
+ }
136
+ };
137
+
138
+ const onChange = (e) => setResponse(e.target.value);
139
+
140
+ return html`
141
+ <form class=${form} onSubmit=${onSubmit}>
142
+ <label htmlFor=${prompt + " prompt"}>
143
+ ${prompt || "Enter your guess"}:
144
+ </label>
145
+ <input
146
+ class=${input}
147
+ id=${prompt + " prompt"}
148
+ onChange=${onChange}
149
+ required
150
+ type="text"
151
+ value=${response}
152
+ />
153
+ <button type="submit">Submit</button>
154
+ </form>
155
+ `;
156
+ };
157
+
158
+ /**
159
+ * Check answer button, rendered at top of page.
160
+ */
161
+ const CheckButton = ({ prompts }) => {
162
+ const [open, setOpen] = React.useState(false);
163
+ const [feedback, setFeedback] = React.useState("Call in an answer.");
164
+
165
+ const wrapper = css`
166
+ font-family: "PT Sans", sans-serif;
167
+ font-size: 16px;
168
+ font-size: clamp(16px, 2.4vw, 21px);
169
+ height: 2.5em;
170
+
171
+ button {
172
+ background: #555;
173
+ border: none;
174
+ border-radius: 2px;
175
+ color: #fff;
176
+ cursor: pointer;
177
+ display: inline-block;
178
+ font-size: 1em;
179
+ font-family: "PT Sans", sans-serif;
180
+ font-weight: bold;
181
+ line-height: 1.2;
182
+ padding: 0.25em 1em;
183
+ text-align: center;
184
+ text-decoration: none;
185
+ text-transform: none;
186
+ }
187
+
188
+ p {
189
+ margin: 0 0 1em;
190
+ }
191
+
192
+ a {
193
+ color: inherit !important;
194
+ }
195
+ `;
196
+
197
+ const btnTop = [2015, 2016].includes(getYear())
198
+ ? "50px"
199
+ : [2012].includes(getYear())
200
+ ? "-2.5em"
201
+ : "0px";
202
+
203
+ const button = css`
204
+ box-sizing: border-box;
205
+ height: 2.5em;
206
+ left: 0;
207
+ position: absolute;
208
+ top: ${btnTop};
209
+ width: 100%;
210
+ z-index: 9999;
211
+ `;
212
+
213
+ const dropdownWrapper = css`
214
+ background: #edeff0;
215
+ color: #121212;
216
+ left: 0;
217
+ position: absolute;
218
+ right: 0;
219
+ top: calc(2.5em + ${btnTop});
220
+ z-index: 9999;
221
+ `;
222
+
223
+ const dropdown = css`
224
+ margin: 0 auto;
225
+ max-width: 40em;
226
+ padding: 1em;
227
+ z-index: 9999;
228
+ `;
229
+
230
+ const responses = css`
231
+ margin: 0 auto;
232
+ width: fit-content;
233
+
234
+ @media (max-width: 600px) {
235
+ width: auto;
236
+ }
237
+ `;
238
+
239
+ const onClick = () => setOpen(!open);
240
+
241
+ const body =
242
+ prompts.length > 0
243
+ ? prompts.map(
244
+ (group) =>
245
+ html`<${ResponseRow} setFeedback=${setFeedback} ...${group} />`
246
+ )
247
+ : html`<p>
248
+ No answers found on this page. Please report this to${" "}
249
+ <a href="mailto:puzzle@mit.edu">puzzle@mit.edu</a>.
250
+ </p>`;
251
+
252
+ return html`
253
+ <style>
254
+ @import url("https://fonts.googleapis.com/css2?family=PT+Sans:wght@400;700&display=swap");
255
+
256
+ ${[2015, 2016].includes(getYear()) &&
257
+ ".navbar-fixed-top { z-index: 10000 }"}
258
+ ${[2012].includes(getYear()) &&
259
+ "body { top: 2.5em } #check-answer, #shortcuts { z-index: 10000 !important }"}
260
+ ${[2006].includes(getYear()) && 'img[alt="Check Answer"] { display: none }'}
261
+ </style>
262
+ <div class=${wrapper}>
263
+ <button class=${button} onClick=${onClick}>
264
+ Check your answers spoiler-free
265
+ </button>
266
+ ${open &&
267
+ html`
268
+ <div class=${dropdownWrapper}>
269
+ <div class=${dropdown}>
270
+ <p>${feedback}</p>
271
+ <div class=${responses}>${body}</div>
272
+ </div>
273
+ </div>
274
+ `}
275
+ </div>
276
+ `;
277
+ };
278
+
279
+ const data = await getData();
280
+ const prompts = getAnswers(data, document.URL);
281
+ render(html`<${CheckButton} prompts=${prompts} />`, container);
benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1_7_Puzzle.html/index.html ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <HTML>
2
+ <HEAD>
3
+ <TITLE>Mystery Hunt 2000, Set 1</TITLE>
4
+ <LINK REV=owns HREF="mailto:puzzle@mit.edu">
5
+ </HEAD>
6
+
7
+ <BODY TEXT="#303030" BGCOLOR="#FFFFFF" LINK="#330066" ALINK="#000000"
8
+ VLINK="#000000">
9
+
10
+
11
+
12
+ <table width=100% border=0>
13
+ <tr><td align=left valign=top><h2>
14
+
15
+ <H3>Puzzles, Set 1</H3>
16
+
17
+ </h2></td>
18
+ <td align=right valign=top width=300>
19
+ <a href="../index.html">Back to hunt</a>
20
+ </td></tr></table>
21
+
22
+
23
+ <BLOCKQUOTE>
24
+ <A HREF="1/Puzzle.html">Puzzle 1</A> <A HREF="1/Solution.html">Solution 1</A><BR>
25
+ <A HREF="2/Puzzle.html">Puzzle 2</A> <A HREF="2/Solution.html">Solution 2</A><BR>
26
+ <A HREF="3/Puzzle.html">Puzzle 3</A> <A HREF="3/Solution.html">Solution 3</A><BR>
27
+ <A HREF="4/Puzzle.html">Puzzle 4</A> <A HREF="4/Solution.html">Solution 4</A><BR>
28
+ <A HREF="5/Puzzle.html">Puzzle 5</A> <A HREF="5/Solution.html">Solution 5</A><BR>
29
+ <A HREF="6/Puzzle.html">Puzzle 6</A> <A HREF="6/Solution.html">Solution 6</A><BR>
30
+ <A HREF="7/Puzzle.html">Puzzle 7</A> <A HREF="7/Solution.html">Solution 7</A><BR>
31
+ <A HREF="8/Puzzle.html">Puzzle 8</A> <A HREF="8/Solution.html">Solution 8</A><BR>
32
+ <A HREF="9/Puzzle.html">Puzzle 9</A> <A HREF="9/Solution.html">Solution 9</A><BR>
33
+ <A HREF="10/Puzzle.html">Puzzle 10</A> <A HREF="10/Solution.html">Solution 10</A><BR>
34
+ <A HREF="11/Puzzle.html">Puzzle 11</A> <A HREF="11/Solution.html">Solution 11</A><BR>
35
+ <BR>
36
+ <A HREF="../hints/hint1.txt">Hint</A> <A HREF="../hints/solution1.txt">Hint Solution</A><BR>
37
+ <A HREF="Meta/Solution.html">Metapuzzle Solution</A><BR>
38
+ </BLOCKQUOTE>
39
+ If you participated in the Hunt, please fill out the <A HREF="../survey.txt">survey</A>.
40
+
41
+ </BODY><script type="module" src="/checkanswer.js"></script>
42
+ </HTML>
benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1_8_Puzzle.html/Puzzle.html ADDED
@@ -0,0 +1,429 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <html>
2
+
3
+ <head>
4
+ <title>
5
+
6
+
7
+ Mystery Hunt 2000, Puzzle 1.8
8
+
9
+ </title>
10
+ </head>
11
+
12
+ <body text=#303030 bgcolor=#ffffff link=#330066 alink=#000000 vlink=#000000>
13
+
14
+ <table width=100% border=0>
15
+ <tr><td align=left valign=top><h2>
16
+
17
+ <!-- XXX Edit this part here -->
18
+ 1.8: Rack Your Brain
19
+
20
+ </h2></td>
21
+ <td align=right valign=top width=300>
22
+ <a href="../../index.html">Back to hunt</a> | <a href="../index.html">Back to puzzle set</a>
23
+ </td></tr></table>
24
+
25
+ <blockquote><i>
26
+
27
+ <!-- XXX Edit this part here -->
28
+ Dorothy approached the young man, who seemed to be studying something on the
29
+ table in front of him, deep in thought. He was an unusual-looking fellow,
30
+ with keen eyes and a large bushy beard of fire-red hair; and, despite the
31
+ blizzard outside, he was wearing shorts. As Dorothy got closer, she could
32
+ see that the focus of his interest was a Scrabble board he had spread out
33
+ in front of him.
34
+
35
+ <p>"Are you playing Scrabble?" asked Dorothy.
36
+ <p>"Yes," said the man.
37
+ <p>"Who are you playing against?"
38
+ <p>"Myself."
39
+ <p>"You're practising?"
40
+ <p>"Yes."
41
+ <p>Dorothy studied the perplexing board, full of unfamiliar words.
42
+ "What does VUG mean?"
43
+ <p>"A cavity in a rock."
44
+ <p>"Do you know the definitions of all the words you play?"
45
+ <p>"No."
46
+ <p>"Wouldn't it be more fun if you only played words that you know the
47
+ meaning of?"
48
+ <p>"Why?"
49
+ <p>"Well, because... because...." But Dorothy realised she couldn't
50
+ find the words to justify her instinct. "Anyway, you seem to be awfully good
51
+ at this. Would you mind teaching me a little?"
52
+ <p>"Alright."
53
+ <p>So Dorothy sat down across from the man, and they began to play. "My name
54
+ is Dorothy, by the way. What's yours?"
55
+
56
+
57
+
58
+ </i></blockquote>
59
+
60
+ <center>
61
+
62
+ <table border=0 cellpadding=2 cellspacing=2>
63
+ <tr>
64
+ <td align=center width=6%>
65
+ <td align=center width=6%>A
66
+ <td align=center width=6%>B
67
+ <td align=center width=6%>C
68
+ <td align=center width=6%>D
69
+ <td align=center width=6%>E
70
+ <td align=center width=6%>F
71
+ <td align=center width=6%>G
72
+ <td align=center width=6%>H
73
+ <td align=center width=6%>I
74
+ <td align=center width=6%>J
75
+ <td align=center width=6%>K
76
+ <td align=center width=6%>L
77
+ <td align=center width=6%>M
78
+ <td align=center width=6%>N
79
+ <td align=center width=6%>O
80
+ <tr>
81
+ <td align=right>1
82
+ <td align=center bgcolor=#ff6666>&nbsp;
83
+ <td align=center bgcolor=#cccccc>&nbsp;
84
+ <td align=center bgcolor=#cccccc>&nbsp;
85
+ <td align=center bgcolor=#ccccff>&nbsp;
86
+ <TD ALIGN=center bgcolor=#ffcc99>V
87
+ <TD ALIGN=center bgcolor=#ffcc99>U
88
+ <TD ALIGN=center bgcolor=#ffcc99>G
89
+ <TD ALIGN=center bgcolor=#ffcc99>S
90
+ <td align=center bgcolor=#cccccc>&nbsp;
91
+ <td align=center bgcolor=#cccccc>&nbsp;
92
+ <td align=center bgcolor=#cccccc>&nbsp;
93
+ <td align=center bgcolor=#ccccff>&nbsp;
94
+ <td align=center bgcolor=#cccccc>&nbsp;
95
+ <td align=center bgcolor=#cccccc>&nbsp;
96
+ <td align=center bgcolor=#ff6666>&nbsp;
97
+ <tr>
98
+ <td align=right>2
99
+ <td align=center bgcolor=#cccccc>&nbsp;
100
+ <td align=center bgcolor=#ffcccc>&nbsp;
101
+ <td align=center bgcolor=#cccccc>&nbsp;
102
+ <td align=center bgcolor=#cccccc>&nbsp;
103
+ <td align=center bgcolor=#cccccc>&nbsp;
104
+ <td align=center bgcolor=#6666ff>&nbsp;
105
+ <td align=center bgcolor=#cccccc>&nbsp;
106
+ <TD ALIGN=center bgcolor=#ffcc99>T
107
+ <td align=center bgcolor=#cccccc>&nbsp;
108
+ <td align=center bgcolor=#6666ff>&nbsp;
109
+ <td align=center bgcolor=#cccccc>&nbsp;
110
+ <td align=center bgcolor=#cccccc>&nbsp;
111
+ <td align=center bgcolor=#cccccc>&nbsp;
112
+ <td align=center bgcolor=#ffcccc>&nbsp;
113
+ <td align=center bgcolor=#cccccc>&nbsp;
114
+ <tr>
115
+ <td align=right>3
116
+ <td align=center bgcolor=#cccccc>&nbsp;
117
+ <td align=center bgcolor=#cccccc>&nbsp;
118
+ <td align=center bgcolor=#ffcccc>&nbsp;
119
+ <td align=center bgcolor=#cccccc>&nbsp;
120
+ <td align=center bgcolor=#cccccc>&nbsp;
121
+ <td align=center bgcolor=#cccccc>&nbsp;
122
+ <td align=center bgcolor=#ccccff>&nbsp;
123
+ <TD ALIGN=center bgcolor=#ffcc99>O
124
+ <td align=center bgcolor=#ccccff>&nbsp;
125
+ <td align=center bgcolor=#cccccc>&nbsp;
126
+ <td align=center bgcolor=#cccccc>&nbsp;
127
+ <td align=center bgcolor=#cccccc>&nbsp;
128
+ <td align=center bgcolor=#ffcccc>&nbsp;
129
+ <td align=center bgcolor=#cccccc>&nbsp;
130
+ <td align=center bgcolor=#cccccc>&nbsp;
131
+ <tr>
132
+ <td align=right>4
133
+ <td align=center bgcolor=#ccccff>&nbsp;
134
+ <td align=center bgcolor=#cccccc>&nbsp;
135
+ <td align=center bgcolor=#cccccc>&nbsp;
136
+ <td align=center bgcolor=#ffcccc>&nbsp;
137
+ <td align=center bgcolor=#cccccc>&nbsp;
138
+ <td align=center bgcolor=#cccccc>&nbsp;
139
+ <td align=center bgcolor=#cccccc>&nbsp;
140
+ <TD ALIGN=center bgcolor=#ffcc99>A
141
+ <td align=center bgcolor=#ffcc99><i>b</i>
142
+ <td align=center bgcolor=#cccccc>&nbsp;
143
+ <td align=center bgcolor=#cccccc>&nbsp;
144
+ <td align=center bgcolor=#ffcccc>&nbsp;
145
+ <td align=center bgcolor=#cccccc>&nbsp;
146
+ <td align=center bgcolor=#cccccc>&nbsp;
147
+ <td align=center bgcolor=#ccccff>&nbsp;
148
+ <tr>
149
+ <td align=right>5
150
+ <td align=center bgcolor=#cccccc>&nbsp;
151
+ <td align=center bgcolor=#cccccc>&nbsp;
152
+ <td align=center bgcolor=#cccccc>&nbsp;
153
+ <td align=center bgcolor=#cccccc>&nbsp;
154
+ <td align=center bgcolor=#ffcccc>&nbsp;
155
+ <TD ALIGN=center bgcolor=#ffcc99>S
156
+ <td align=center bgcolor=#cccccc>&nbsp;
157
+ <td align=center bgcolor=#cccccc>&nbsp;
158
+ <TD ALIGN=center bgcolor=#ffcc99>E
159
+ <td align=center bgcolor=#cccccc>&nbsp;
160
+ <td align=center bgcolor=#cccccc>&nbsp;
161
+ <td align=center bgcolor=#cccccc>&nbsp;
162
+ <td align=center bgcolor=#cccccc>&nbsp;
163
+ <td align=center bgcolor=#cccccc>&nbsp;
164
+ <td align=center bgcolor=#cccccc>&nbsp;
165
+ <tr>
166
+ <td align=right>6
167
+ <td align=center bgcolor=#cccccc>&nbsp;
168
+ <td align=center bgcolor=#6666ff>&nbsp;
169
+ <td align=center bgcolor=#cccccc>&nbsp;
170
+ <td align=center bgcolor=#cccccc>&nbsp;
171
+ <TD ALIGN=center bgcolor=#ffcc99>T
172
+ <TD ALIGN=center bgcolor=#ffcc99>O
173
+ <td align=center bgcolor=#cccccc>&nbsp;
174
+ <td align=center bgcolor=#cccccc>&nbsp;
175
+ <TD ALIGN=center bgcolor=#ffcc99>G
176
+ <TD ALIGN=center bgcolor=#ffcc99>E
177
+ <TD ALIGN=center bgcolor=#ffcc99>O
178
+ <TD ALIGN=center bgcolor=#ffcc99>D
179
+ <TD ALIGN=center bgcolor=#ffcc99>U
180
+ <TD ALIGN=center bgcolor=#ffcc99>C
181
+ <TD ALIGN=center bgcolor=#ffcc99>K
182
+ <tr>
183
+ <td align=right>7
184
+ <td align=center bgcolor=#cccccc>&nbsp;
185
+ <td align=center bgcolor=#cccccc>&nbsp;
186
+ <td align=center bgcolor=#ccccff>&nbsp;
187
+ <td align=center bgcolor=#cccccc>&nbsp;
188
+ <TD ALIGN=center bgcolor=#ffcc99>H
189
+ <TD ALIGN=center bgcolor=#ffcc99>A
190
+ <TD ALIGN=center bgcolor=#ffcc99>R
191
+ <TD ALIGN=center bgcolor=#ffcc99>P
192
+ <TD ALIGN=center bgcolor=#ffcc99>O
193
+ <TD ALIGN=center bgcolor=#ffcc99>O
194
+ <TD ALIGN=center bgcolor=#ffcc99>N
195
+ <td align=center bgcolor=#cccccc>&nbsp;
196
+ <td align=center bgcolor=#ccccff>&nbsp;
197
+ <td align=center bgcolor=#cccccc>&nbsp;
198
+ <td align=center bgcolor=#cccccc>&nbsp;
199
+ <tr>
200
+ <td align=right>8
201
+ <td align=center bgcolor=#ff6666>&nbsp;
202
+ <td align=center bgcolor=#cccccc>&nbsp;
203
+ <td align=center bgcolor=#cccccc>&nbsp;
204
+ <TD ALIGN=center bgcolor=#ffcc99>B
205
+ <TD ALIGN=center bgcolor=#ffcc99>A
206
+ <TD ALIGN=center bgcolor=#ffcc99>R
207
+ <td align=center bgcolor=#cccccc>&nbsp;
208
+ <TD ALIGN=center bgcolor=#ffcc99>A
209
+ <TD ALIGN=center bgcolor=#ffcc99>N
210
+ <TD ALIGN=center bgcolor=#ffcc99>N
211
+ <TD ALIGN=center bgcolor=#ffcc99>E
212
+ <TD ALIGN=center bgcolor=#ffcc99>X
213
+ <td align=center bgcolor=#cccccc>&nbsp;
214
+ <td align=center bgcolor=#cccccc>&nbsp;
215
+ <td align=center bgcolor=#ff6666>&nbsp;
216
+ <tr>
217
+ <td align=right>9
218
+ <td align=center bgcolor=#cccccc>&nbsp;
219
+ <td align=center bgcolor=#cccccc>&nbsp;
220
+ <td align=center bgcolor=#ccccff>&nbsp;
221
+ <TD ALIGN=center bgcolor=#ffcc99>A
222
+ <TD ALIGN=center bgcolor=#ffcc99>N
223
+ <TD ALIGN=center bgcolor=#ffcc99>E
224
+ <td align=center bgcolor=#ccccff>&nbsp;
225
+ <td align=center bgcolor=#cccccc>&nbsp;
226
+ <TD ALIGN=center bgcolor=#ffcc99>I
227
+ <td align=center bgcolor=#cccccc>&nbsp;
228
+ <td align=center bgcolor=#cccccc>&nbsp;
229
+ <td align=center bgcolor=#cccccc>&nbsp;
230
+ <td align=center bgcolor=#ccccff>&nbsp;
231
+ <td align=center bgcolor=#cccccc>&nbsp;
232
+ <td align=center bgcolor=#cccccc>&nbsp;
233
+ <tr>
234
+ <td align=right>10
235
+ <td align=center bgcolor=#cccccc>&nbsp;
236
+ <td align=center bgcolor=#6666ff>&nbsp;
237
+ <td align=center bgcolor=#cccccc>&nbsp;
238
+ <TD ALIGN=center bgcolor=#ffcc99>L
239
+ <TD ALIGN=center bgcolor=#ffcc99>E
240
+ <TD ALIGN=center bgcolor=#ffcc99>D
241
+ <td align=center bgcolor=#cccccc>&nbsp;
242
+ <TD ALIGN=center bgcolor=#ffcc99>F
243
+ <TD ALIGN=center bgcolor=#ffcc99>A
244
+ <td align=center bgcolor=#cccccc>&nbsp;
245
+ <td align=center bgcolor=#cccccc>&nbsp;
246
+ <td align=center bgcolor=#cccccc>&nbsp;
247
+ <td align=center bgcolor=#cccccc>&nbsp;
248
+ <td align=center bgcolor=#6666ff>&nbsp;
249
+ <td align=center bgcolor=#cccccc>&nbsp;
250
+ <tr>
251
+ <td align=right>11
252
+ <td align=center bgcolor=#cccccc>&nbsp;
253
+ <td align=center bgcolor=#cccccc>&nbsp;
254
+ <td align=center bgcolor=#cccccc>&nbsp;
255
+ <td align=center bgcolor=#ffcc99><i>l</i>
256
+ <td align=center bgcolor=#cccccc>&nbsp;
257
+ <td align=center bgcolor=#cccccc>&nbsp;
258
+ <td align=center bgcolor=#cccccc>&nbsp;
259
+ <TD ALIGN=center bgcolor=#ffcc99>O
260
+ <TD ALIGN=center bgcolor=#ffcc99>S
261
+ <td align=center bgcolor=#cccccc>&nbsp;
262
+ <td align=center bgcolor=#ffcccc>&nbsp;
263
+ <td align=center bgcolor=#cccccc>&nbsp;
264
+ <td align=center bgcolor=#cccccc>&nbsp;
265
+ <td align=center bgcolor=#cccccc>&nbsp;
266
+ <td align=center bgcolor=#cccccc>&nbsp;
267
+ <tr>
268
+ <td align=right>12
269
+ <td align=center bgcolor=#ccccff>&nbsp;
270
+ <td align=center bgcolor=#cccccc>&nbsp;
271
+ <td align=center bgcolor=#cccccc>&nbsp;
272
+ <TD ALIGN=center bgcolor=#ffcc99>S
273
+ <td align=center bgcolor=#cccccc>&nbsp;
274
+ <td align=center bgcolor=#cccccc>&nbsp;
275
+ <td align=center bgcolor=#cccccc>&nbsp;
276
+ <TD ALIGN=center bgcolor=#ffcc99>R
277
+ <td align=center bgcolor=#cccccc>&nbsp;
278
+ <td align=center bgcolor=#cccccc>&nbsp;
279
+ <td align=center bgcolor=#cccccc>&nbsp;
280
+ <td align=center bgcolor=#ffcccc>&nbsp;
281
+ <td align=center bgcolor=#cccccc>&nbsp;
282
+ <td align=center bgcolor=#cccccc>&nbsp;
283
+ <td align=center bgcolor=#ccccff>&nbsp;
284
+ <tr>
285
+ <td align=right>13
286
+ <td align=center bgcolor=#cccccc>&nbsp;
287
+ <td align=center bgcolor=#cccccc>&nbsp;
288
+ <td align=center bgcolor=#ffcccc>&nbsp;
289
+ <td align=center bgcolor=#cccccc>&nbsp;
290
+ <td align=center bgcolor=#cccccc>&nbsp;
291
+ <td align=center bgcolor=#cccccc>&nbsp;
292
+ <td align=center bgcolor=#ccccff>&nbsp;
293
+ <TD ALIGN=center bgcolor=#ffcc99>M
294
+ <td align=center bgcolor=#ccccff>&nbsp;
295
+ <td align=center bgcolor=#cccccc>&nbsp;
296
+ <td align=center bgcolor=#cccccc>&nbsp;
297
+ <td align=center bgcolor=#cccccc>&nbsp;
298
+ <td align=center bgcolor=#ffcccc>&nbsp;
299
+ <td align=center bgcolor=#cccccc>&nbsp;
300
+ <td align=center bgcolor=#cccccc>&nbsp;
301
+ <tr>
302
+ <td align=right>14
303
+ <td align=center bgcolor=#cccccc>&nbsp;
304
+ <td align=center bgcolor=#ffcccc>&nbsp;
305
+ <td align=center bgcolor=#cccccc>&nbsp;
306
+ <td align=center bgcolor=#cccccc>&nbsp;
307
+ <td align=center bgcolor=#cccccc>&nbsp;
308
+ <td align=center bgcolor=#6666ff>&nbsp;
309
+ <td align=center bgcolor=#cccccc>&nbsp;
310
+ <TD ALIGN=center bgcolor=#ffcc99>E
311
+ <td align=center bgcolor=#cccccc>&nbsp;
312
+ <td align=center bgcolor=#6666ff>&nbsp;
313
+ <td align=center bgcolor=#cccccc>&nbsp;
314
+ <td align=center bgcolor=#cccccc>&nbsp;
315
+ <td align=center bgcolor=#cccccc>&nbsp;
316
+ <td align=center bgcolor=#ffcccc>&nbsp;
317
+ <td align=center bgcolor=#cccccc>&nbsp;
318
+ <tr>
319
+ <td align=right>15
320
+ <td align=center bgcolor=#ff6666>&nbsp;
321
+ <td align=center bgcolor=#cccccc>&nbsp;
322
+ <td align=center bgcolor=#cccccc>&nbsp;
323
+ <td align=center bgcolor=#ccccff>&nbsp;
324
+ <td align=center bgcolor=#cccccc>&nbsp;
325
+ <td align=center bgcolor=#cccccc>&nbsp;
326
+ <td align=center bgcolor=#cccccc>&nbsp;
327
+ <TD ALIGN=center bgcolor=#ffcc99>E
328
+ <td align=center bgcolor=#cccccc>&nbsp;
329
+ <td align=center bgcolor=#cccccc>&nbsp;
330
+ <td align=center bgcolor=#cccccc>&nbsp;
331
+ <td align=center bgcolor=#ccccff>&nbsp;
332
+ <td align=center bgcolor=#cccccc>&nbsp;
333
+ <td align=center bgcolor=#cccccc>&nbsp;
334
+ <td align=center bgcolor=#ff6666>&nbsp;
335
+ <tr>
336
+ <td colspan=16><br>
337
+ <tr>
338
+ <td align=right colspan=4>
339
+ <td>
340
+ <td align=center bgcolor=#ffcc99>V
341
+ <td align=center bgcolor=#ffcc99>I
342
+ <td align=center bgcolor=#ffcc99>N
343
+ <td align=center bgcolor=#ffcc99>Y
344
+ <td align=center bgcolor=#ffcc99>L
345
+ <tr>
346
+ <td align=right colspan=4>
347
+ <td>
348
+ <td align=center bgcolor=#ffcc99>B
349
+ <td align=center bgcolor=#ffcc99>R
350
+ <td align=center bgcolor=#ffcc99>O
351
+ <td align=center bgcolor=#ffcc99>A
352
+ <td align=center bgcolor=#ffcc99>D
353
+ <tr>
354
+ <td align=right colspan=4>
355
+ <td>
356
+ <td align=center bgcolor=#ffcc99>M
357
+ <td align=center bgcolor=#ffcc99>A
358
+ <td align=center bgcolor=#ffcc99>R
359
+ <td align=center bgcolor=#ffcc99>T
360
+ <tr>
361
+ <td align=right colspan=4>
362
+ <td>
363
+ <td align=center bgcolor=#ffcc99>P
364
+ <td align=center bgcolor=#ffcc99>I
365
+ <td align=center bgcolor=#ffcc99>N
366
+ <td align=center bgcolor=#ffcc99>C
367
+ <td align=center bgcolor=#ffcc99>E
368
+ <td align=center bgcolor=#ffcc99>R
369
+ <tr>
370
+ <td align=right colspan=4>
371
+ <td>
372
+ <td align=center bgcolor=#ffcc99>L
373
+ <td align=center bgcolor=#ffcc99>E
374
+ <td align=center bgcolor=#ffcc99>A
375
+ <td align=center bgcolor=#ffcc99>F
376
+ <td align=center bgcolor=#ffcc99>E
377
+ <td align=center bgcolor=#ffcc99>D
378
+ <tr>
379
+ <td align=right colspan=4>
380
+ <td>
381
+ <td align=center bgcolor=#ffcc99>L
382
+ <td align=center bgcolor=#ffcc99>I
383
+ <td align=center bgcolor=#ffcc99>G
384
+ <td align=center bgcolor=#ffcc99>H
385
+ <td align=center bgcolor=#ffcc99>T
386
+ </table>
387
+
388
+ </center>
389
+
390
+ <p>Notation: lowercase letters denote blank tiles; the blank at 4I has been
391
+ used as a B, and the blank at 11D has been used as an L.
392
+
393
+ </body><script type="module" src="/checkanswer.js"></script>
394
+ </html>
395
+
396
+
397
+
398
+
399
+
400
+
401
+
402
+
403
+
404
+
405
+
406
+
407
+
408
+
409
+
410
+
411
+
412
+
413
+
414
+
415
+
416
+
417
+
418
+
419
+
420
+
421
+
422
+
423
+
424
+
425
+
426
+
427
+
428
+
429
+
benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1_8_Puzzle.html/checkanswer.js ADDED
@@ -0,0 +1,281 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Do this first so that layout shift isn't too bad:
2
+ const container = document.createElement("div");
3
+ container.style = `
4
+ font-size: 16px;
5
+ font-size: clamp(16px, 2.4vw, 21px);
6
+ height: 2.5em;
7
+ `;
8
+ document.body.prepend(container);
9
+
10
+ import { React, html, css, render } from "./package.js";
11
+
12
+ /**
13
+ * Remove non-alphanumeric characters.
14
+ */
15
+ const normalizeAnswer = (answer) => {
16
+ if (getYear() === 2003) {
17
+ if (document.URL.includes("teamGuest/2")) {
18
+ // Special case: 2003 R2, whose answers are emoji.
19
+ return answer.trim();
20
+ } else if (document.URL.includes("6_3")) {
21
+ // Special case: Answer is literal Greek letter.
22
+ return answer.trim();
23
+ }
24
+ }
25
+ return answer.toUpperCase().replaceAll(/[^A-Z0-9]/g, "");
26
+ };
27
+
28
+ /**
29
+ * Returns the year of the hunt we're in.
30
+ */
31
+ const getYear = () => {
32
+ return Number(RegExp(`^.*/([0-9]{4})/.*$`).exec(document.URL)?.[1] ?? 0);
33
+ };
34
+
35
+ /**
36
+ * Fetches the answers as a list of {url, answer, prompt, intermediate}.
37
+ */
38
+ const getData = async () => {
39
+ const res = await fetch("/answers.tsv");
40
+ const data = await res.text();
41
+ const [header, ...body] = data.split("\n");
42
+ const headers = header.trim().split("\t");
43
+ return body.map((row) => {
44
+ const res = {};
45
+ row.split("\t").forEach((item, i) => {
46
+ res[headers[i]] = item.trim();
47
+ });
48
+ return res;
49
+ });
50
+ };
51
+
52
+ /**
53
+ * Gets the base URL; removes trailing index.html and .html, removes everything
54
+ * before the year, and then removes trailing slash.
55
+ */
56
+ const getBase = (url) => {
57
+ const root =
58
+ RegExp(`^(.*/)index.html`).exec(url)?.[1] ??
59
+ RegExp(`^(.*).html`).exec(url)?.[1] ??
60
+ url;
61
+ const base = RegExp(`^.*/([0-9]{4}/.*)$`).exec(root)?.[1] ?? root;
62
+ return base.endsWith("/") ? base.slice(0, -1) : base;
63
+ };
64
+
65
+ /**
66
+ * Get all rows in the data corresponding to a given URL. Group by same prompt.
67
+ */
68
+ const getAnswers = (data, url) => {
69
+ const base = getBase(url);
70
+ const rows = data.filter((row) => getBase(row.url) === base);
71
+ const prompts = [];
72
+ for (const row of rows) {
73
+ const { prompt } = row;
74
+ const group = prompts.find((group) => group.prompt === prompt);
75
+ if (group) {
76
+ group.rows.push(row);
77
+ } else {
78
+ prompts.push({ prompt, rows: [row] });
79
+ }
80
+ }
81
+ return prompts;
82
+ };
83
+
84
+ /**
85
+ * A single textbox and submit button in the rows of possible responses.
86
+ */
87
+ const ResponseRow = ({ prompt, rows, setFeedback }) => {
88
+ const [response, setResponse] = React.useState("");
89
+
90
+ const form = css`
91
+ align-items: baseline;
92
+ display: flex;
93
+ justify-content: right;
94
+ margin-bottom: 0.5em;
95
+
96
+ @media (max-width: 600px) {
97
+ align-items: flex-start;
98
+ flex-direction: column;
99
+ }
100
+ `;
101
+
102
+ const input = css`
103
+ background: #fafafa;
104
+ border: 1px solid #aaa;
105
+ border-radius: 2px;
106
+ color: #121212;
107
+ font-family: inherit;
108
+ font-size: 100%;
109
+ line-height: 1.2;
110
+ margin: 0 0.5em;
111
+ padding: 0.25em 0.5em;
112
+
113
+ @media (max-width: 600px) {
114
+ margin: 0 0 0.25em;
115
+ }
116
+ `;
117
+
118
+ const onSubmit = (e) => {
119
+ e.preventDefault();
120
+ let set = false;
121
+ for (const row of rows) {
122
+ const correct = normalizeAnswer(row.answer) === normalizeAnswer(response);
123
+ if (correct) {
124
+ setFeedback(
125
+ row.intermediate?.trim() === "TRUE"
126
+ ? "Correct! See the solution page for the answer."
127
+ : `Solved! The answer was ${row.answer}.`
128
+ );
129
+ set = true;
130
+ break;
131
+ }
132
+ }
133
+ if (!set) {
134
+ setFeedback("Incorrect.");
135
+ }
136
+ };
137
+
138
+ const onChange = (e) => setResponse(e.target.value);
139
+
140
+ return html`
141
+ <form class=${form} onSubmit=${onSubmit}>
142
+ <label htmlFor=${prompt + " prompt"}>
143
+ ${prompt || "Enter your guess"}:
144
+ </label>
145
+ <input
146
+ class=${input}
147
+ id=${prompt + " prompt"}
148
+ onChange=${onChange}
149
+ required
150
+ type="text"
151
+ value=${response}
152
+ />
153
+ <button type="submit">Submit</button>
154
+ </form>
155
+ `;
156
+ };
157
+
158
+ /**
159
+ * Check answer button, rendered at top of page.
160
+ */
161
+ const CheckButton = ({ prompts }) => {
162
+ const [open, setOpen] = React.useState(false);
163
+ const [feedback, setFeedback] = React.useState("Call in an answer.");
164
+
165
+ const wrapper = css`
166
+ font-family: "PT Sans", sans-serif;
167
+ font-size: 16px;
168
+ font-size: clamp(16px, 2.4vw, 21px);
169
+ height: 2.5em;
170
+
171
+ button {
172
+ background: #555;
173
+ border: none;
174
+ border-radius: 2px;
175
+ color: #fff;
176
+ cursor: pointer;
177
+ display: inline-block;
178
+ font-size: 1em;
179
+ font-family: "PT Sans", sans-serif;
180
+ font-weight: bold;
181
+ line-height: 1.2;
182
+ padding: 0.25em 1em;
183
+ text-align: center;
184
+ text-decoration: none;
185
+ text-transform: none;
186
+ }
187
+
188
+ p {
189
+ margin: 0 0 1em;
190
+ }
191
+
192
+ a {
193
+ color: inherit !important;
194
+ }
195
+ `;
196
+
197
+ const btnTop = [2015, 2016].includes(getYear())
198
+ ? "50px"
199
+ : [2012].includes(getYear())
200
+ ? "-2.5em"
201
+ : "0px";
202
+
203
+ const button = css`
204
+ box-sizing: border-box;
205
+ height: 2.5em;
206
+ left: 0;
207
+ position: absolute;
208
+ top: ${btnTop};
209
+ width: 100%;
210
+ z-index: 9999;
211
+ `;
212
+
213
+ const dropdownWrapper = css`
214
+ background: #edeff0;
215
+ color: #121212;
216
+ left: 0;
217
+ position: absolute;
218
+ right: 0;
219
+ top: calc(2.5em + ${btnTop});
220
+ z-index: 9999;
221
+ `;
222
+
223
+ const dropdown = css`
224
+ margin: 0 auto;
225
+ max-width: 40em;
226
+ padding: 1em;
227
+ z-index: 9999;
228
+ `;
229
+
230
+ const responses = css`
231
+ margin: 0 auto;
232
+ width: fit-content;
233
+
234
+ @media (max-width: 600px) {
235
+ width: auto;
236
+ }
237
+ `;
238
+
239
+ const onClick = () => setOpen(!open);
240
+
241
+ const body =
242
+ prompts.length > 0
243
+ ? prompts.map(
244
+ (group) =>
245
+ html`<${ResponseRow} setFeedback=${setFeedback} ...${group} />`
246
+ )
247
+ : html`<p>
248
+ No answers found on this page. Please report this to${" "}
249
+ <a href="mailto:puzzle@mit.edu">puzzle@mit.edu</a>.
250
+ </p>`;
251
+
252
+ return html`
253
+ <style>
254
+ @import url("https://fonts.googleapis.com/css2?family=PT+Sans:wght@400;700&display=swap");
255
+
256
+ ${[2015, 2016].includes(getYear()) &&
257
+ ".navbar-fixed-top { z-index: 10000 }"}
258
+ ${[2012].includes(getYear()) &&
259
+ "body { top: 2.5em } #check-answer, #shortcuts { z-index: 10000 !important }"}
260
+ ${[2006].includes(getYear()) && 'img[alt="Check Answer"] { display: none }'}
261
+ </style>
262
+ <div class=${wrapper}>
263
+ <button class=${button} onClick=${onClick}>
264
+ Check your answers spoiler-free
265
+ </button>
266
+ ${open &&
267
+ html`
268
+ <div class=${dropdownWrapper}>
269
+ <div class=${dropdown}>
270
+ <p>${feedback}</p>
271
+ <div class=${responses}>${body}</div>
272
+ </div>
273
+ </div>
274
+ `}
275
+ </div>
276
+ `;
277
+ };
278
+
279
+ const data = await getData();
280
+ const prompts = getAnswers(data, document.URL);
281
+ render(html`<${CheckButton} prompts=${prompts} />`, container);
benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1_8_Puzzle.html/index.html ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <HTML>
2
+ <HEAD>
3
+ <TITLE>Mystery Hunt 2000, Set 1</TITLE>
4
+ <LINK REV=owns HREF="mailto:puzzle@mit.edu">
5
+ </HEAD>
6
+
7
+ <BODY TEXT="#303030" BGCOLOR="#FFFFFF" LINK="#330066" ALINK="#000000"
8
+ VLINK="#000000">
9
+
10
+
11
+
12
+ <table width=100% border=0>
13
+ <tr><td align=left valign=top><h2>
14
+
15
+ <H3>Puzzles, Set 1</H3>
16
+
17
+ </h2></td>
18
+ <td align=right valign=top width=300>
19
+ <a href="../index.html">Back to hunt</a>
20
+ </td></tr></table>
21
+
22
+
23
+ <BLOCKQUOTE>
24
+ <A HREF="1/Puzzle.html">Puzzle 1</A> <A HREF="1/Solution.html">Solution 1</A><BR>
25
+ <A HREF="2/Puzzle.html">Puzzle 2</A> <A HREF="2/Solution.html">Solution 2</A><BR>
26
+ <A HREF="3/Puzzle.html">Puzzle 3</A> <A HREF="3/Solution.html">Solution 3</A><BR>
27
+ <A HREF="4/Puzzle.html">Puzzle 4</A> <A HREF="4/Solution.html">Solution 4</A><BR>
28
+ <A HREF="5/Puzzle.html">Puzzle 5</A> <A HREF="5/Solution.html">Solution 5</A><BR>
29
+ <A HREF="6/Puzzle.html">Puzzle 6</A> <A HREF="6/Solution.html">Solution 6</A><BR>
30
+ <A HREF="7/Puzzle.html">Puzzle 7</A> <A HREF="7/Solution.html">Solution 7</A><BR>
31
+ <A HREF="8/Puzzle.html">Puzzle 8</A> <A HREF="8/Solution.html">Solution 8</A><BR>
32
+ <A HREF="9/Puzzle.html">Puzzle 9</A> <A HREF="9/Solution.html">Solution 9</A><BR>
33
+ <A HREF="10/Puzzle.html">Puzzle 10</A> <A HREF="10/Solution.html">Solution 10</A><BR>
34
+ <A HREF="11/Puzzle.html">Puzzle 11</A> <A HREF="11/Solution.html">Solution 11</A><BR>
35
+ <BR>
36
+ <A HREF="../hints/hint1.txt">Hint</A> <A HREF="../hints/solution1.txt">Hint Solution</A><BR>
37
+ <A HREF="Meta/Solution.html">Metapuzzle Solution</A><BR>
38
+ </BLOCKQUOTE>
39
+ If you participated in the Hunt, please fill out the <A HREF="../survey.txt">survey</A>.
40
+
41
+ </BODY><script type="module" src="/checkanswer.js"></script>
42
+ </HTML>
benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1_9_Puzzle.html/Puzzle.html ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <html>
2
+
3
+ <head>
4
+ <title>
5
+
6
+
7
+ Mystery Hunt 2000, Puzzle 1.9
8
+
9
+ </title>
10
+ </head>
11
+
12
+ <body text=#303030 bgcolor=#ffffff link=#330066 alink=#000000 vlink=#000000>
13
+
14
+ <table width=100% border=0>
15
+ <tr><td align=left valign=top><h2>
16
+
17
+ <!-- XXX Edit this part here -->
18
+ 1.9: Oh, to be in DC
19
+
20
+ </h2></td>
21
+ <td align=right valign=top width=300>
22
+ <a href="../../index.html">Back to hunt</a> | <a href="../index.html">Back to puzzle set</a>
23
+ </td></tr></table>
24
+
25
+ <blockquote><i>
26
+
27
+ <!-- XXX Edit this part here -->
28
+
29
+ Dorothy went to see a W.I.Z.A.R.D. system administrator for some help getting into
30
+ the system, only to find the
31
+ following note posted on her door: <p>
32
+
33
+ <blockquote>
34
+ I'm on vacation this month. My itinerary is below; if you need to
35
+ get in touch with me, the standard people in each country will
36
+ have my address.<BR>
37
+ </blockquote>
38
+
39
+ </i></blockquote>
40
+
41
+ <pre>
42
+
43
+ TW 96 Friday, Jan 7 7:00 AM - 11:52 AM
44
+ LI 311 Friday, Jan 7 1:45 PM - 2:20 PM
45
+ LI 351 Friday, Jan 7 3:50 PM - 4:25 PM
46
+
47
+ Lodging: Seaview Hotel
48
+
49
+ IW 343 Wednesday, Jan 12 3:35 PM - Thursday, Jan 13 6:50 AM
50
+ TK 1828 Thursday, Jan 13 4:05 PM - Thursday, Jan 13 8:30 PM
51
+ TK 1386 Thursday, Jan 13 10:45 PM - Friday, Jan 14 3:05 AM
52
+
53
+ Lodging: Hotel Victoria
54
+
55
+ SR 3495 Sunday, Jan 16. 4:40 AM - 6:10 AM
56
+ TG 971 Sunday, Jan 16. 1:30 PM - 6:10 AM
57
+ TG 690 Monday, Jan 17 8:20 AM - 9:30 AM
58
+
59
+ Lodging: Belvedere Hotel
60
+
61
+ VN 820 Thursday, Jan 20 12:30 PM - 1:40 PM
62
+ VN 924 Thursday, Jan 20 3:00 PM - 7:15 PM
63
+ AA 7408 Thursday, Jan 20 11:30 PM - 6:15PM
64
+ AA 198 Thursday, Jan 20 10:00 PM - Friday, Jan 21 6:34 AM
65
+
66
+
67
+ </pre>
68
+
69
+ </body><script type="module" src="/checkanswer.js"></script>
70
+ </html>
benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1_9_Puzzle.html/checkanswer.js ADDED
@@ -0,0 +1,281 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Do this first so that layout shift isn't too bad:
2
+ const container = document.createElement("div");
3
+ container.style = `
4
+ font-size: 16px;
5
+ font-size: clamp(16px, 2.4vw, 21px);
6
+ height: 2.5em;
7
+ `;
8
+ document.body.prepend(container);
9
+
10
+ import { React, html, css, render } from "./package.js";
11
+
12
+ /**
13
+ * Remove non-alphanumeric characters.
14
+ */
15
+ const normalizeAnswer = (answer) => {
16
+ if (getYear() === 2003) {
17
+ if (document.URL.includes("teamGuest/2")) {
18
+ // Special case: 2003 R2, whose answers are emoji.
19
+ return answer.trim();
20
+ } else if (document.URL.includes("6_3")) {
21
+ // Special case: Answer is literal Greek letter.
22
+ return answer.trim();
23
+ }
24
+ }
25
+ return answer.toUpperCase().replaceAll(/[^A-Z0-9]/g, "");
26
+ };
27
+
28
+ /**
29
+ * Returns the year of the hunt we're in.
30
+ */
31
+ const getYear = () => {
32
+ return Number(RegExp(`^.*/([0-9]{4})/.*$`).exec(document.URL)?.[1] ?? 0);
33
+ };
34
+
35
+ /**
36
+ * Fetches the answers as a list of {url, answer, prompt, intermediate}.
37
+ */
38
+ const getData = async () => {
39
+ const res = await fetch("/answers.tsv");
40
+ const data = await res.text();
41
+ const [header, ...body] = data.split("\n");
42
+ const headers = header.trim().split("\t");
43
+ return body.map((row) => {
44
+ const res = {};
45
+ row.split("\t").forEach((item, i) => {
46
+ res[headers[i]] = item.trim();
47
+ });
48
+ return res;
49
+ });
50
+ };
51
+
52
+ /**
53
+ * Gets the base URL; removes trailing index.html and .html, removes everything
54
+ * before the year, and then removes trailing slash.
55
+ */
56
+ const getBase = (url) => {
57
+ const root =
58
+ RegExp(`^(.*/)index.html`).exec(url)?.[1] ??
59
+ RegExp(`^(.*).html`).exec(url)?.[1] ??
60
+ url;
61
+ const base = RegExp(`^.*/([0-9]{4}/.*)$`).exec(root)?.[1] ?? root;
62
+ return base.endsWith("/") ? base.slice(0, -1) : base;
63
+ };
64
+
65
+ /**
66
+ * Get all rows in the data corresponding to a given URL. Group by same prompt.
67
+ */
68
+ const getAnswers = (data, url) => {
69
+ const base = getBase(url);
70
+ const rows = data.filter((row) => getBase(row.url) === base);
71
+ const prompts = [];
72
+ for (const row of rows) {
73
+ const { prompt } = row;
74
+ const group = prompts.find((group) => group.prompt === prompt);
75
+ if (group) {
76
+ group.rows.push(row);
77
+ } else {
78
+ prompts.push({ prompt, rows: [row] });
79
+ }
80
+ }
81
+ return prompts;
82
+ };
83
+
84
+ /**
85
+ * A single textbox and submit button in the rows of possible responses.
86
+ */
87
+ const ResponseRow = ({ prompt, rows, setFeedback }) => {
88
+ const [response, setResponse] = React.useState("");
89
+
90
+ const form = css`
91
+ align-items: baseline;
92
+ display: flex;
93
+ justify-content: right;
94
+ margin-bottom: 0.5em;
95
+
96
+ @media (max-width: 600px) {
97
+ align-items: flex-start;
98
+ flex-direction: column;
99
+ }
100
+ `;
101
+
102
+ const input = css`
103
+ background: #fafafa;
104
+ border: 1px solid #aaa;
105
+ border-radius: 2px;
106
+ color: #121212;
107
+ font-family: inherit;
108
+ font-size: 100%;
109
+ line-height: 1.2;
110
+ margin: 0 0.5em;
111
+ padding: 0.25em 0.5em;
112
+
113
+ @media (max-width: 600px) {
114
+ margin: 0 0 0.25em;
115
+ }
116
+ `;
117
+
118
+ const onSubmit = (e) => {
119
+ e.preventDefault();
120
+ let set = false;
121
+ for (const row of rows) {
122
+ const correct = normalizeAnswer(row.answer) === normalizeAnswer(response);
123
+ if (correct) {
124
+ setFeedback(
125
+ row.intermediate?.trim() === "TRUE"
126
+ ? "Correct! See the solution page for the answer."
127
+ : `Solved! The answer was ${row.answer}.`
128
+ );
129
+ set = true;
130
+ break;
131
+ }
132
+ }
133
+ if (!set) {
134
+ setFeedback("Incorrect.");
135
+ }
136
+ };
137
+
138
+ const onChange = (e) => setResponse(e.target.value);
139
+
140
+ return html`
141
+ <form class=${form} onSubmit=${onSubmit}>
142
+ <label htmlFor=${prompt + " prompt"}>
143
+ ${prompt || "Enter your guess"}:
144
+ </label>
145
+ <input
146
+ class=${input}
147
+ id=${prompt + " prompt"}
148
+ onChange=${onChange}
149
+ required
150
+ type="text"
151
+ value=${response}
152
+ />
153
+ <button type="submit">Submit</button>
154
+ </form>
155
+ `;
156
+ };
157
+
158
+ /**
159
+ * Check answer button, rendered at top of page.
160
+ */
161
+ const CheckButton = ({ prompts }) => {
162
+ const [open, setOpen] = React.useState(false);
163
+ const [feedback, setFeedback] = React.useState("Call in an answer.");
164
+
165
+ const wrapper = css`
166
+ font-family: "PT Sans", sans-serif;
167
+ font-size: 16px;
168
+ font-size: clamp(16px, 2.4vw, 21px);
169
+ height: 2.5em;
170
+
171
+ button {
172
+ background: #555;
173
+ border: none;
174
+ border-radius: 2px;
175
+ color: #fff;
176
+ cursor: pointer;
177
+ display: inline-block;
178
+ font-size: 1em;
179
+ font-family: "PT Sans", sans-serif;
180
+ font-weight: bold;
181
+ line-height: 1.2;
182
+ padding: 0.25em 1em;
183
+ text-align: center;
184
+ text-decoration: none;
185
+ text-transform: none;
186
+ }
187
+
188
+ p {
189
+ margin: 0 0 1em;
190
+ }
191
+
192
+ a {
193
+ color: inherit !important;
194
+ }
195
+ `;
196
+
197
+ const btnTop = [2015, 2016].includes(getYear())
198
+ ? "50px"
199
+ : [2012].includes(getYear())
200
+ ? "-2.5em"
201
+ : "0px";
202
+
203
+ const button = css`
204
+ box-sizing: border-box;
205
+ height: 2.5em;
206
+ left: 0;
207
+ position: absolute;
208
+ top: ${btnTop};
209
+ width: 100%;
210
+ z-index: 9999;
211
+ `;
212
+
213
+ const dropdownWrapper = css`
214
+ background: #edeff0;
215
+ color: #121212;
216
+ left: 0;
217
+ position: absolute;
218
+ right: 0;
219
+ top: calc(2.5em + ${btnTop});
220
+ z-index: 9999;
221
+ `;
222
+
223
+ const dropdown = css`
224
+ margin: 0 auto;
225
+ max-width: 40em;
226
+ padding: 1em;
227
+ z-index: 9999;
228
+ `;
229
+
230
+ const responses = css`
231
+ margin: 0 auto;
232
+ width: fit-content;
233
+
234
+ @media (max-width: 600px) {
235
+ width: auto;
236
+ }
237
+ `;
238
+
239
+ const onClick = () => setOpen(!open);
240
+
241
+ const body =
242
+ prompts.length > 0
243
+ ? prompts.map(
244
+ (group) =>
245
+ html`<${ResponseRow} setFeedback=${setFeedback} ...${group} />`
246
+ )
247
+ : html`<p>
248
+ No answers found on this page. Please report this to${" "}
249
+ <a href="mailto:puzzle@mit.edu">puzzle@mit.edu</a>.
250
+ </p>`;
251
+
252
+ return html`
253
+ <style>
254
+ @import url("https://fonts.googleapis.com/css2?family=PT+Sans:wght@400;700&display=swap");
255
+
256
+ ${[2015, 2016].includes(getYear()) &&
257
+ ".navbar-fixed-top { z-index: 10000 }"}
258
+ ${[2012].includes(getYear()) &&
259
+ "body { top: 2.5em } #check-answer, #shortcuts { z-index: 10000 !important }"}
260
+ ${[2006].includes(getYear()) && 'img[alt="Check Answer"] { display: none }'}
261
+ </style>
262
+ <div class=${wrapper}>
263
+ <button class=${button} onClick=${onClick}>
264
+ Check your answers spoiler-free
265
+ </button>
266
+ ${open &&
267
+ html`
268
+ <div class=${dropdownWrapper}>
269
+ <div class=${dropdown}>
270
+ <p>${feedback}</p>
271
+ <div class=${responses}>${body}</div>
272
+ </div>
273
+ </div>
274
+ `}
275
+ </div>
276
+ `;
277
+ };
278
+
279
+ const data = await getData();
280
+ const prompts = getAnswers(data, document.URL);
281
+ render(html`<${CheckButton} prompts=${prompts} />`, container);
benchmark/MIT_Mystery_Hunt/puzzles/by_tsv/2000/2000_set1_9_Puzzle.html/index.html ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <HTML>
2
+ <HEAD>
3
+ <TITLE>Mystery Hunt 2000, Set 1</TITLE>
4
+ <LINK REV=owns HREF="mailto:puzzle@mit.edu">
5
+ </HEAD>
6
+
7
+ <BODY TEXT="#303030" BGCOLOR="#FFFFFF" LINK="#330066" ALINK="#000000"
8
+ VLINK="#000000">
9
+
10
+
11
+
12
+ <table width=100% border=0>
13
+ <tr><td align=left valign=top><h2>
14
+
15
+ <H3>Puzzles, Set 1</H3>
16
+
17
+ </h2></td>
18
+ <td align=right valign=top width=300>
19
+ <a href="../index.html">Back to hunt</a>
20
+ </td></tr></table>
21
+
22
+
23
+ <BLOCKQUOTE>
24
+ <A HREF="1/Puzzle.html">Puzzle 1</A> <A HREF="1/Solution.html">Solution 1</A><BR>
25
+ <A HREF="2/Puzzle.html">Puzzle 2</A> <A HREF="2/Solution.html">Solution 2</A><BR>
26
+ <A HREF="3/Puzzle.html">Puzzle 3</A> <A HREF="3/Solution.html">Solution 3</A><BR>
27
+ <A HREF="4/Puzzle.html">Puzzle 4</A> <A HREF="4/Solution.html">Solution 4</A><BR>
28
+ <A HREF="5/Puzzle.html">Puzzle 5</A> <A HREF="5/Solution.html">Solution 5</A><BR>
29
+ <A HREF="6/Puzzle.html">Puzzle 6</A> <A HREF="6/Solution.html">Solution 6</A><BR>
30
+ <A HREF="7/Puzzle.html">Puzzle 7</A> <A HREF="7/Solution.html">Solution 7</A><BR>
31
+ <A HREF="8/Puzzle.html">Puzzle 8</A> <A HREF="8/Solution.html">Solution 8</A><BR>
32
+ <A HREF="9/Puzzle.html">Puzzle 9</A> <A HREF="9/Solution.html">Solution 9</A><BR>
33
+ <A HREF="10/Puzzle.html">Puzzle 10</A> <A HREF="10/Solution.html">Solution 10</A><BR>
34
+ <A HREF="11/Puzzle.html">Puzzle 11</A> <A HREF="11/Solution.html">Solution 11</A><BR>
35
+ <BR>
36
+ <A HREF="../hints/hint1.txt">Hint</A> <A HREF="../hints/solution1.txt">Hint Solution</A><BR>
37
+ <A HREF="Meta/Solution.html">Metapuzzle Solution</A><BR>
38
+ </BLOCKQUOTE>
39
+ If you participated in the Hunt, please fill out the <A HREF="../survey.txt">survey</A>.
40
+
41
+ </BODY><script type="module" src="/checkanswer.js"></script>
42
+ </HTML>