Jump to content

Artificial Intelligence Memory.


The Legendary Super Derp

Recommended Posts

Hi, Im Having a little Trouble With An AI That Can Hold Memory. I Have 5 Strings (Memory Cartridges Or What You Would Call It.)

    string MEMORY1 = "";
    string MEMORY2 = "";
    string MEMORY3 = "";
    string MEMORY4 = "";
    string MEMORY5 = "";

And When You Type Text into the chat bot, it holds a memory in the memory cartridges. like so:

    cin >> MEMORY1; // Goes into the MEMORY 1 cartridge
    
And if you type a certain thing into the first memory card it will effect the second:
 cin >> MEMORY1;
    if(MEMORY1 == "hello"){
      Response = "Hi, Im Sam.\n";
      cout << Response;
    }
    cin >> MEMORY2;
    if(MEMORY2 == "Example"){
      if(MEMORY1 == "hello"){
        Response = "thanks!";
        cout << Response;
      }
    }

but if i used  2 words, It would skip over, but if theres no other one, like my example. it ends the program.
TL:DR : If i use 2 words for chatbot ai text, it skips and ends program.
this is the first c++ program ive ever made, so it would mean a lot if you can help me :)

Link to comment
Share on other sites

  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...