C++: Bot
Hello, I'm not trying to programming a advance bot. I want some ideas how I should do. I want a bot who can answer on simple question. example. ask: What do wanna know? [putting in for example PHP] answer: Php is a server-side programming language.
I don't wanna make an if and else function for about 100-200 things. I want make it easier! Maybe an external file should be nice but how can I search and get information from an external file. I know how to open and read but not search in the file. Can I get some help/ideas ?
Best regards, Erox
First thing I think of is making a MySQL-database (or other kind of database), make a table with one field with keyword(s) and one field with the actual answer.
Then:
SELECT answer FROM table_name WHERE keywords LIKE '% <question here> &'
And display the first one. Or you could create another search algorithm, But I think of a kind of search engine-like thing.
<EDIT>The example I gave would at least work for searching for one specific term</EDIT>