...if you can't figure out where/how to place that code, I really don't think you're ready for a dip in the AI pool...
I got bored and wrote this up real quick:
that's not a very useful/scalable example, so I wouldn't use it (and besides, if you ask it who wrote the declaration of independence, it just tells you who wrote the bot), but there are some things you can take away from it... like how there are different ways to say hello/goodbye/etc, and how people capitalize differently, and a whole host of different things like what if somebody forgets a space or their english isn't the best? what about the differences from "howdy/hello/hi/hey there/what up/hai2u/etc."
void capitalize(std::string &input);
std::cout<<"Hello. I am testBot. Please reply with an empty line\n"
<<"to end our conversation\n> ";
if(input=="HI" || input=="HELLO" || input=="HEY" || input=="YO")
std::cout<<"Hello, how can I help you today?\n> ";
std::cout<<"I was written by Major_Small\n> ";
else if(input=="" || input=="BYE" || input=="GOODBYE" ||
input=="LATER" || input=="NIGHT" || input=="GOODNIGHT")
std::cout<<"Good bye for now."<<std::endl;
std::cout<<"Sorry, I could not recogize your accent\n> ";
void capitalize(std::string &input)
register short int l;
register short int r;
you may want to write a file with questions and responses and use a scoring system or something. for example, have "who/wrote/made/created/you/this/bot" as something to check the input against and have "I was created by me" as the response to that. Now check the input sentence for the words and give that answer a score. the response with the highest score gets output.
These ideas are all my own, and to be honest, I don't know a whole lot about AI programming, so you'd probably be better off asking somebody else, but like I said, just look at the code and take note of some of the pitfalls you'll want to look into getting over...