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