Hi, being a proficient googler, this is my first time using a forum EVER, so please bear with me.
I've been looking up how to create a database file that works like a dictionary, having a string with corresponding values stored in different entries on the same line. The problem is, while there is a lot of help out there on previous forums, the context of the questions are very different to what my database(s) are needed for.
I've put this in the beginner's forums because I think what I'm working on is (ambitious) beginner code but with advanced logic. The most advanced stuff I've done is defining strings as 'char[]' instead of 'string'.
Some contextual notes:
I've created a zork-style text based adventure game engine from scratch using string comparison functions and a LOT of arrays/improvised dictionaries. The memory-hungriness has been manageable from this point, but I am planning on implementing an AI feature, so you can interact dynamically with NPCs in the game. e.g. if you insult the NPC, it insults you back. If you go too far, it tries to kill you.
As a result, using arrays to contain literally the entire english dictionary and corresponding machine-understandable instructions will be, well, silly.
The handy thing though, is that because this is in-game, I only need to worry about adjectives, prepositions, verbs, and pronouns. I can leave out a massive amount of nouns out, because if they don't exist in the game, they don't need to be taught to the AI!
To make my question a bit clearer:
I need to create a SIMPLE database file or otherwise to store a list of english words and corresponding machine-understandable entries.
e.g. (adjective dictionary)
1 2 3
|
happy, EH1,
ecstatic, EH3,
sad, ES1,
|
I also will need help finding out how to read the file quickly, and get the corresponding values with minimal stress!
I've probably given more information than needed, but too much information is better than too little, I guess.
ANY help would be appreciated, and I welcome any other suggestions you may have for me to improve my game!
By the way if other forums are anything to go by, you might appreciate that I have no intention of making money off any of this, open source and all that, this is just a side project of mine with a chance of getting into a science fair...