Your goal is to make it to the bottom of the dungeon alive. You will find the answer you seek on the last level.

(And don't forget that you can hit 'z' to undo, even after dying.)