4 ms·
The coffee part also resonated stongly with me, for a completely different reason :) I spent last year thinking on how to implement a text-only simulation that
by jmiskovic 7y ago
The coffee part also resonated stongly with me, for a completely different reason :)
I spent last year thinking on how to implement a text-only simulation that could cope with just about any situation. Most of my models were mentally evaluated on this "simple" task of making coffee. The design I came up with (still to be implemented) is not code driven, but data driven. Instead of executing bunch of nested if-elses, I'd have a big list of tuples that contain <action, preconditions, reaction>. When action is performed upon object, this list is traversed. For each element, it's preconditions are compared to current world state. Based on this criteria the most suitable element is selected, and it's reaction is applied to modify world's state.
Your list could be used as preconditions for action of brewing coffee; each would produce different results ranging from nice coffee to yucky mud or broken machine. I'd like to include a nice built-in editor that could be utilized to quickly modify or add reactions, objects, or world state variables. I have most of it figured out but it's a lot of work to put together all the pieces.
- Doxin 7y agoSounds like it could make for a fun variation on the text adventure, where having stuff go wrong is at least as amusing as actually solving puzzles.