forked from atesgoral/hrm-solutions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
208 lines (164 loc) · 9.95 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
<!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;
}
</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="http://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="http://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>
<table class="table table-condensed table-bordered table-hover">
<tr>
<th><div align="right">Level</div></th>
<th>Name</th>
<th>Size/Par</th>
<th>Speed/Par</th>
</tr>
<%
_.forEach(topScores, function (level) {
if (level.cutscene) {
%>
<tr class="text-muted">
<td align="right"><%= level.number %></td>
<td colspan="3"><%= 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>
</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>.</p>
<h2>Data API</h2>
<p>You can fetch an index of all solutions from:</p>
<p><a href="http://atesgoral.github.io/hrm-solutions/data/index.json">http://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="http://atesgoral.github.io/hrm-solutions/data/index.js">http://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="http://atesgoral.github.io/hrm-solutions/data/1/fc41e23f26bc4b2c9008818a2af1578a.json">http://atesgoral.github.io/hrm-solutions/data/1/fc41e23f26bc4b2c9008818a2af1578a.json</a></p>
<p>Or similarly, for JSONP:</p>
<p><a href="http://atesgoral.github.io/hrm-solutions/data/1/fc41e23f26bc4b2c9008818a2af1578a.js">http://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>
</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>