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