A solution to the CodeCombat Gridmancer challenge level.