I thought up a...whaddaya call those things? Engine? Algorithm? Anyways, its basically an idea i came up with to do a text adventure...Tell me if it would work, how i could change it to make it better, if it's good, whatever...remember im new to this langauge, so go easy on me... anyways, here it is:

Make an int variable, originally set it to zero. When the player has completed a certain task (i.e., unlock the door) + one to the int varable. Use the int number further in the text adventure, to decide other things based on what you have completed so far. (e.g. if(compl==10){....)