I want to make a simple game similar to the choose-your-own-adventure books. The player is presented with a narrative text and gets to choose his action from a list of possibilities. This, in turn, leads to a new narrative text, ad infinitum. The only catch is that depending on some previous decisions, the list of possibilities might differ.
At first glance, this sounds like a load of if-else statements, thus implying a rule engine would be in place. But, it also sounds like a finite state machine to me.
I am about to write this in Java or maybe Groovy. I'm currently more interested in the conceptual issues, i.e. how should this be done on a broad level (how do people implement chess or card games, anyway?), but some advice on a specific library in also welcome.
Obviously, the "game engine" from the title does not refer to collision detection or other physics/graphics mechanics, but the logic deciding what options does a player have given the situation and his current state.