Wasn't this game already posted, a while ago? Seems to me I've played it before.
Anyone interested in creating these kind of games might want to look at the Quest Markup Language (
www.questml.com). It's free, can be played in your browser (either on your pc or online) tho I think it might require Explorer. It's free, can be coded to prevent cheating and is quite sophisticated.
I played around with queslml for a while, but never finished the game. I am concentrating on my writing, and other things. It might be of interest to some here.