Thanks, however, your code is fine. I was just unlucky... great game!
Does taking time affect random encounters? (I died before I could find anything). Other than that, this has amazing potential.