I'm in my first semester of university and I have to make a text adventure game in c++. So far we've done arrays, structs, and pointers. I've tried to google my problem, however most other users use classes which we have not yet done.
The professor would like us to use commands like Go North
, open door with key
etc.
I've managed to make it work by using hotkeys like n
to go north, but obviously I would like to do it like he wants us to.
So my question is; how can I make a command consisting of several strings?
The problem is that we need to create libraries for the command, the object and (if there is the possibility in this room to combine two things) the preposition with another object. In each library there should be the words to use, for example: Commands are: Use, go, talk, read, etc...