Solution to level 10 in Untrusted: http://alex.nisnevich.com/untrusted/