-
Notifications
You must be signed in to change notification settings - Fork 178
/
index.html
483 lines (436 loc) · 15.8 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
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
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link
rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"
integrity="sha512-dTfge/zgoMYpP7QbHy4gWMEGsbsdZeCXz7irItjcC3sPUFtf0kuFbDz/ixG7ArTxmDjLXDmezHubeNikyKGVyQ=="
crossorigin="anonymous"
/>
<style>
.level-data {
margin-left: 0.25em;
}
.floor td {
width: 3em;
height: 3em;
position: relative;
text-align: center;
line-height: 3em;
}
.floor td .index {
color: #aaa;
font-size: 0.75em;
line-height: 1em;
padding: 0.125em;
position: absolute;
right: 0;
bottom: 0;
}
@media (prefers-color-scheme: dark) {
body {
background: #111;
filter: invert(1);
}
img {
filter: invert(1);
}
.popover .label {
filter: invert(1);
}
}
</style>
<script src="//code.jquery.com/jquery-1.11.3.min.js"></script>
<script
src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"
integrity="sha512-K1qjQ+NcF2TYO/eI3M6v8EiNYZfA95pQumfvcVrTHtwQVDG+aHRqLi/ETn2uB+1JqwYqVG3LIvdm9lj6imS/pQ=="
crossorigin="anonymous"
></script>
<script>
$(function () {
$('[data-toggle="popover"]').popover();
});
</script>
</head>
<body class="container">
<a href="https://github.com/atesgoral/hrm-solutions"
><img
style="position: absolute; top: 0; right: 0; border: 0; z-index: 1"
src="https://camo.githubusercontent.com/38ef81f8aca64bb9a64448d0d70f1308ef5341ab/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6461726b626c75655f3132313632312e706e67"
alt="Fork me on GitHub"
data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png"
/></a>
<div class="page-header">
<div class="row">
<div class="col-md-6">
<h1>Human Resource Machine solutions</h1>
<p class="lead">
<a href="https://tomorrowcorporation.com/humanresourcemachine"
>Human Resource Machine</a
>
is a fun, little, dark-humoured puzzle game that either can teach
you assembly from the ground up or allow you to put your existing
assembly knowledge into practice in coming up with speed/size
optimized solutions to increasingly hard problems.
</p>
</div>
<div class="col-md-6">
<p>
<img
src="https://cloud.githubusercontent.com/assets/50832/14685819/1f1fdb3e-0704-11e6-83e1-900967e639c3.png"
alt="Screenshot"
class="img-responsive img-thumbnail"
/>
</p>
</div>
</div>
<blockquote>
<p>
Human Resource Machine is a puzzle game. In each level, your boss
gives you a job. Automate it by programming your little office worker!
If you succeed, you'll be promoted up to the next level for another
year of work in the vast office building. Congratulations!
</p>
<footer>
<a href="https://tomorrowcorporation.com/">Tomorrow Corporation</a>
</footer>
</blockquote>
</div>
<p>
This repo contains working solutions, in hopes of exchanging ideas to
collaboratively come up with the most/size.speed optimized solutions (or
simply to help those out there who are stuck). Even though the programs
are created through a drag-and-drop interface within the game, copy/paste
from/to the clipboard works as assembly source code seen in this repo.
</p>
<p>
<a href="https://github.com/atesgoral/hrm-solutions"
>Head over to the repo</a
>
to browse all solutions.
</p>
<p>To import one of these solutions into the game:</p>
<ol>
<li>Open the file</li>
<li>Select all</li>
<li>Copy to clipboard</li>
<li>Go to the game</li>
<li>Paste from clipboard</li>
</ol>
<h2>Top Scores</h2>
<h3>Non input-specific</h3>
<table class="table table-condensed table-bordered table-hover">
<tr>
<th width="60px"><div align="right">Level</div></th>
<th width="230px">Name</th>
<th>Size/Par</th>
<th>Speed/Par</th>
<th>Smallest That Meets Speed Challenge</th>
<th>Fastest That Meets Size Challenge</th>
</tr>
<% _.forEach(topScores, function (level) { if (level.cutscene) { %>
<tr class="text-muted">
<td align="right"><%= level.number %></td>
<td colspan="5"><%= level.name %></td>
</tr>
<% } else { %>
<tr>
<td align="right"><%= level.number %></td>
<td>
<%= level.name %>
<span
class="level-data text-info pull-right glyphicon glyphicon-info-sign"
title="Instructions"
aria-hidden="true"
data-toggle="popover"
data-trigger="hover"
data-placement="right"
data-html="true"
data-content="<%- level.instructionsHtml %>"
></span>
<span
class="level-data text-info pull-right glyphicon glyphicon-cog"
title="Allowed"
aria-hidden="true"
data-toggle="popover"
data-trigger="hover"
data-placement="right"
data-html="true"
data-content="<%- level.commandsHtml + '\n' + level.featuresHtml %>"
></span>
<% if (level.floorHtml) { %>
<span
class="level-data text-info pull-right glyphicon glyphicon-th"
title="Floor"
aria-hidden="true"
data-toggle="popover"
data-trigger="hover"
data-placement="right"
data-html="true"
data-content="<%- level.floorHtml %>"
></span>
<% } %>
</td>
<td>
<a
href="https://github.com/atesgoral/hrm-solutions/blob/master/solutions/<%= level.minSizeProgram.path %>"
><%= level.minSizeProgram.size + '/' + level.challenge.size %></a
>
by
<a href="https://github.com/<%= level.minSizeProgram.author %>"
>@<%= level.minSizeProgram.author %></a
>
</td>
<td>
<a
href="https://github.com/atesgoral/hrm-solutions/blob/master/solutions/<%= level.minStepsProgram.path %>"
><%= level.minStepsProgram.steps + '/' + level.challenge.speed %></a
>
by
<a href="<%= 'https://github.com/' + level.minStepsProgram.author %>"
><%= '@' + level.minStepsProgram.author %></a
>
</td>
<td>
<a
href="https://github.com/atesgoral/hrm-solutions/blob/master/solutions/<%= level.minSizeParProgram.path %>"
><%= level.minSizeParProgram.size + '/' + level.challenge.size %></a
>
by
<a href="https://github.com/<%= level.minSizeParProgram.author %>"
>@<%= level.minSizeParProgram.author %></a
>
(in <%= level.minSizeParProgram.steps + '/' + level.challenge.speed
%>)
</td>
<td>
<a
href="https://github.com/atesgoral/hrm-solutions/blob/master/solutions/<%= level.minStepsParProgram.path %>"
><%= level.minStepsParProgram.steps + '/' + level.challenge.speed
%></a
>
by
<a
href="<%= 'https://github.com/' + level.minStepsParProgram.author %>"
><%= '@' + level.minStepsParProgram.author %></a
>
(in <%= level.minStepsParProgram.size + '/' + level.challenge.size %>)
</td>
</tr>
<% } }); %>
</table>
<h3>Fastest Programs, Input-specific Code Allowed</h3>
<table class="table table-condensed table-bordered table-hover">
<tr>
<th width="60px"><div align="right">Level</div></th>
<th width="230px">Name</th>
<th>Fastest (Input-specific allowed)</th>
<th>Fastest (Input-specific allowed, all tests pass)</th>
</tr>
<% _.forEach(topScores, function (level) { if (level.cutscene) { %>
<tr class="text-muted">
<td align="right"><%= level.number %></td>
<td colspan="5"><%= level.name %></td>
</tr>
<% } else { %>
<tr>
<td align="right"><%= level.number %></td>
<td>
<%= level.name %>
<span
class="level-data text-info pull-right glyphicon glyphicon-info-sign"
title="Instructions"
aria-hidden="true"
data-toggle="popover"
data-trigger="hover"
data-placement="right"
data-html="true"
data-content="<%- level.instructionsHtml %>"
></span>
<span
class="level-data text-info pull-right glyphicon glyphicon-cog"
title="Allowed"
aria-hidden="true"
data-toggle="popover"
data-trigger="hover"
data-placement="right"
data-html="true"
data-content="<%- level.commandsHtml + '\n' + level.featuresHtml %>"
></span>
<% if (level.floorHtml) { %>
<span
class="level-data text-info pull-right glyphicon glyphicon-th"
title="Floor"
aria-hidden="true"
data-toggle="popover"
data-trigger="hover"
data-placement="right"
data-html="true"
data-content="<%- level.floorHtml %>"
></span>
<% } %>
</td>
<td>
<a
href="https://github.com/atesgoral/hrm-solutions/blob/master/solutions/<%= level.minStepsLaxProgram.path %>"
><%= level.minStepsLaxProgram.steps + '/' + level.challenge.speed
%></a
>
by
<a
href="<%= 'https://github.com/' + level.minStepsLaxProgram.author %>"
><%= '@' + level.minStepsLaxProgram.author %></a
>
(in <%= level.minStepsLaxProgram.size + '/' + level.challenge.size
%><% if (![4,28,41].includes(level.number)) { %>, <%=
level.minStepsLaxProgram.successRatio * 100 %>% pass<% } %>)
</td>
<td>
<a
href="https://github.com/atesgoral/hrm-solutions/blob/master/solutions/<%= level.minStepsWorkyProgram.path %>"
><%= level.minStepsWorkyProgram.steps + '/' + level.challenge.speed
%></a
>
by
<a
href="<%= 'https://github.com/' + level.minStepsWorkyProgram.author %>"
><%= '@' + level.minStepsWorkyProgram.author %></a
>
(in <%= level.minStepsWorkyProgram.size + '/' + level.challenge.size
%><%= (level.minStepsWorkyProgram.legal ? ", not input-specific" : "")
%>)
</td>
</tr>
<% } }); %>
</table>
<h2>Wish List</h2>
<p>
The following levels do not have any submitted solution that meets both
size and speed challenges:
</p>
<ul>
<li>02-Busy-Mail-Room (impossible)</li>
<li>19-Countdown</li>
<li>20-Multiplication-Workshop</li>
<li>28-Three-Sort</li>
<li>38-Digit-Exploder</li>
</ul>
<h2>Contributing</h2>
<p>
Please <a href="https://github.com/atesgoral/hrm-solutions">fork</a> and
issue a
<a href="https://help.github.com/articles/using-pull-requests/"
>pull request</a
>. Add yourself to contributors.json if this is your first contribution.
</p>
<h2>Data API</h2>
<p>You can fetch an index of all solutions from:</p>
<p>
<a href="https://atesgoral.github.io/hrm-solutions/data/index.json"
>https://atesgoral.github.io/hrm-solutions/data/index.json</a
>
</p>
<p>
Or, if you want to fetch the index client-side, you can use JSONP with the
callback function hard-coded as "callback":
</p>
<p>
<a href="https://atesgoral.github.io/hrm-solutions/data/index.js"
>https://atesgoral.github.io/hrm-solutions/data/index.js</a
>
</p>
<p>
This index only has metadata of solutions and not the actual sources. To
fetch the metadata and source of a particular solution, use the level
number and hash you obtain from the solution index. For example:
</p>
<p>
<a
href="https://atesgoral.github.io/hrm-solutions/data/1/fc41e23f26bc4b2c9008818a2af1578a.json"
>https://atesgoral.github.io/hrm-solutions/data/1/fc41e23f26bc4b2c9008818a2af1578a.json</a
>
</p>
<p>Or similarly, for JSONP:</p>
<p>
<a
href="https://atesgoral.github.io/hrm-solutions/data/1/fc41e23f26bc4b2c9008818a2af1578a.js"
>https://atesgoral.github.io/hrm-solutions/data/1/fc41e23f26bc4b2c9008818a2af1578a.js</a
>
</p>
<h3>Metadata Properties</h3>
<p>The metadata for each solution has the following properties:</p>
<h4>levelNumber</h4>
<p><em>Number</em>. The level number.</p>
<h4>size</h4>
<p>
<em>Number</em>. Program size. This is the number of instructions
(excluding comments and labels) the program has.
</p>
<h4>steps</h4>
<p>
<em>Number</em>. The average steps the program takes in a successful run
(i.e. the outbox is correct). This is average of 100 runs for some inbox
examples from the game along with randomly generated inboxes.
</p>
<h4>successRatio</h4>
<p>
<em>Number</em>. The ratio of successful runs. If this is 1, the program
is a proper solution that can withstand any randomly generated inbox. If
it's a fraction less than 1, it's a specific solution that exploits the
fixed set of inputs offered by the game to beat a size/speed record. This
ratio cannot be 0 because that essentially means that the solution is just
broken and does not even make it into the solution index.
</p>
<h4>type</h4>
<p>
<em>String</em>. <em>Optional</em>. If this solution is tagged as a
special type of solution, it might be accompanied by a type specifier.
We're still in the process of standardizing these. Currently "specific",
"exploit" and "obsolete" make appearances. Again, this is likely due to
change.
</p>
<h4>author</h4>
<p>
<em>String</em>. <em>Optional</em>. If this solution is a contribution
that is made by a known author, it's the author GitHub username.
</p>
<h4>source</h4>
<p>
<em>String</em>. Only appears in individual solution metadata. This is the
source code of the program.
</p>
<h4>hash</h4>
<p>
<em>String</em>. The MD5 hash of the source code. While it can be used as
a checksum for paranoid situations, it's mainly used as a unique ID for
the purposes of providing this data API.
</p>
<h2>Maintainers</h2>
<ul>
<li>
<a href="https://github.com/atesgoral">@atesgoral</a> (Ates Goral)
</li>
<li><a href="https://github.com/nanashi-juanto">@nanashi-juanto</a></li>
<li><a href="https://github.com/viamodulo">@viamodulo</a></li>
<li>
<a href="https://github.com/clarfonthey">@clarfonthey</a> (Clar Fon)
</li>
</ul>
<h2>Contributors</h2>
<table class="table table-condensed">
<% _.forEach(_.chunk(contributors, 3), function (contributors) { %>
<tr>
<% _.forEach(contributors, function (contributor) { %>
<td>
<a href="https://github.com/<%= contributor.username %>"
>@<%= contributor.username %></a
><% if (contributor.fullName) { %> (<%= contributor.fullName %>)<% }
%>
</td>
<% }); %>
</tr>
<% }); %>
</table>
</body>
</html>