I needed to tweak your source code in order to play past the lab. I think you have a stray exit() on line 56.
Once I took that out I could play the game. I agree with cmd16, it starts frustrating but you get into a groove. It's pretty random but that's the style of this game, strange and unexpected deaths from the obvious answers and success from the less obvious ones.
Nice work.