Re:Two problems I had to solve in my Oxford interview (2013)
by corruptio on Tuesday May 12, 2015 @03:07AM
(#9529976)
My solution:
Handles the zero case. Only uses 4 cells total.
[ Parent
| on HN ]
Re:Two problems I had to solve in my Oxford interview (2013)
by elevensies on Tuesday May 12, 2015 @08:26AM
(#9531188)
Instruction 6 is a nop? if mem. 1 not-equals mem. 3, jump to 7, or else fall thru to 7?
I don't think you can depend on jumping in instruction 3, because you don't control the value of mem. 1, it's input. So if mem. 3 = 0, instructions 2 and 3 will always lead to instruction four.