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