in which I go insane and attempt to write hero quest in javascript