Human Resource Machine

Human Resource Machine

94 ratings
Solution hints, no spoilers
By kermit
Gives hints for basic solutions, size challenges and speed challenges without giving you the acutal code. If you're looking to just copy and paste a complete solution, you'll find them in this repository[].
Year 2 - Busy Mail Room
Speed challenge: 25
You've probably solved the puzzle by using a sequence of input, output, jump to start. The jump instruction does not do any input/output work, but is useful to keep the process repeating.

The jump adds 1 instruction per item that is 'extra' to the actual work required. What if you transported two items before jumping back to the beginning? The extra cost of the jump instruction would be reduced to 1 per two items.

Knowing that this puzzle's input is never longer than 12 items, can you go all the way and pass even below the challenge mark of 25?

The technique used here is called loop unrolling. The goal is to try and avoid the cost of loop iteration instructions at runtime at the cost of verbatim repetitions of loop contents.
Year 9 - Zero Preservation Initiative
Speed Challenge
Unrolling the loop helps here. Just repeat verbatim instead of jumping to beginning.
Year 10 - Octoplier Suite
Size Challenge: 9
If you're struggling to get down to 9 instructions total, the trick is to use the hint given in the game. Can you multiply by 8 using 3 add instructions only?

Obviously, you can't just add the input 3 times. You need to generate intermediate results and add them. Doubling an item 3 times is the same as multiplying it by 8 you know.

a × 2 × 2 × 2 = a × 8
Year 12 - Tetracontiplier
Size Challenge: 14
In this particular challenge it is worth remembering that in the Octoplier level, you found a quick way to create a x 8. Adding this value 4 times onto itself gives you a x 8 x 5 = a x 40.
Implementing the idea efficiently also solves the speed challenge.
Year 14 - Maximization Room
Size Challenge
Realizing that a - b + b = a might help save instructions here.
Year 16 - Absolute Positivity
Subtracting a number from itself twice always generates the original but with the sign inverted. The first subtraction lands you at 0, the second generates the opposite of the original.
x - x - x = (x - x) - x = 0 - x = -x

Year 19 - Countdown
Speed Challenge
Having three separate branches for inputs of 0, positive, negative is good enough to pass.

Year 20 - Multiplication Workshop
Speed Challenge
Early test for multiplication by 0 and remembering that a x b = b x a may minimize the number of loop iterations.
Year 22 - Fibonacci Visitor
Size Challenge
Initializing with 0,1 instead of 1,1 might help reducing instructions, assuming you follow a "add current with predecessor" and "swap predecessor with current" approach.

Speed Challenge
Having two sections of code alternate on where they put the next sequence number cuts down instructions needed for swaps.
Year 28 - Three Sort
Size Challenge
Arrange your a, b, c in a row, swap if necessary, output the row in order.

Speed Challenge
Handle each of the 6 possible outcomes directly.
Year 32 - Inventory Report
Speed Challenge
Realizing that the contents on the floor of this puzzle are constant, and it's only the inputs that vary may lead to a solution drastically below the challenge mark.

Year 35 - Duplicate Removal
Speed Challenge
Unrolling your loop sufficiently is good enough to pass.
Year 36 - Alphabetizer
Size Challenge
Copy both strings, compare, setup which to output, output. Can be done within the instruction limit.

Speed Challenge
For best results, determine if the first or second string are going to be output while building the second one.
Year 38 - Digit Exploder
Speed Challenge
Build a harness that subtracts several 100s or 10s at once. Be efficient.
How about trying 500, 200, then repeat 100, and then trying 50, 20, repeat 10.
Year 39 - Re-Coordinator
Dividing by width of the floor and keeping the remainder is all you need here.
Year 40 - Prime Factory
Size Challenge
You are testing for prime integer factors in ascending order. If you did not bother making sure that the factors tested were prime, what would happen?

Speed Challenge
Several possibilities here, considering that the puzzle inputs are going to be max 20. Check the factors involved.

Even a lookup table containing the smallest factor of a given number is feasible. It gives a speed result of ~ 249 instructions.

Year 41 - Sorting Floor
Size Challenge
Simplest ideas have the least instructions. Ideas like Selection Sort[].

Speed Challenge
The lack of subroutines, a stack, and lack of memory on the floor make using most efficient sorting algorithms impractical.
Unrolling loops and some special handling of the last two unsorted items is enough to pass.
< >
Lupal Fillyus Feb 26 @ 4:24pm 
@DorcasAurelia "Nah, that hint was too direct."
Which is why I PMed him instead of posting pretty much the solution, which is also why he hasn't returned since 20 Jan.
DorcasAurelia Feb 26 @ 12:30pm 
Karpfador, to reduce commands, don't save anything to memory. Also, don't think of it as comparing the two numbers, think of it as using "Jump if negative" to create a branching tree of possibilities. There aren't 2 possibilities (the signs are the same or the signs are different); there are 4 possible combinations (1: first is - and second is -, 2: first is - and second is +, 3: first is + and second is -, or 4: first is + and second is +)
Lupal Fillyus Jan 26 @ 7:05am 
<deletes comment> Nah, that hint was too direct.
Try to determine the smallest number so far, before you INBOX a new number.
yav_at Jan 25 @ 2:46am 
#23, the littlest number.
I managed to require 7x the amount of command blocks and 5x the steps for beating the challenges. Now I'm stuck thinking of a different method to determine to smallest number in a string.
Currently I'm saving all numbers to memory, -bumping them and +bumping a counter. Once any number hits zero, the counter equals the number and is the required output. (The last string takes forever with the bigger numbers, so I figured this approach has to seem completely ridiculous..)
Karpfador Jan 19 @ 6:23pm 
Problem with 17 is, that we can't multiply two numbers with each other to check if they are both positive or both negative. So I checked for each if they are negative and put that to memory to get the solution. I really don't see how to use 4 commands less though
Lupal Fillyus Jan 19 @ 2:28pm 
There are two cases, they are equal or not. It is not necessary to store the values from the inbox.
If still stuck, friend/PM.
Karpfador Jan 19 @ 5:58am 
Ugh. Maybe I could use a hint on 17. I have too many commands still
GhostWolfe Dec 30, 2016 @ 2:22pm 
@Lupal Fillyus Cheers, I'll have another look.
Lupal Fillyus Dec 29, 2016 @ 6:47pm 
If still unclear, add me as friend for the solution.
Lupal Fillyus Dec 29, 2016 @ 6:45pm 
Ah yes, this is such an early year that there is almost a unique solution. Fine.

You need to store the first value, or else you wouldn't be able to retrieve it.
To compare them, you must substract them. You then know which one is the larger one.
If it's the first one, get it and output it. But can you avoid storing the second input?
That's where the hint comes in.

More hint below.

in the hint 'a' is the second input.