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