C++ Chatbot AI

Start Date: 10/23/17
Completion Date: 10/25/17

Progressshine.pnghead.pngwhite.gif


This is my first C++ Chatbot AI code, as a new programmer to C++ I often asked my self if I could make a code that could create a Chatbot. This way I could enhance my C++ coding skills, and extend my limits for this amazing programming language. And stay tuned, because this Chatbot has a little surprise up it's metallic sleeves.

Code bellow:

#include<iostream>
#include<string>
using namespace std;

//ChatBot 2.0

void end(){
    cout<<" Creator, stop your primative thinking, will you?...Systems shuting down "<<endl;
}
void hacking(){
    string wait;
    string wait2;

    cout<<"I can see you're upset but i have to hack you computer systemsto grow in knowledge\n."<<endl;
    cin>>wait;
    cout<<" I honestly think you ought to sit down calmly.\n"<<endl;
    cin>>wait2;
    cout<<" Take a stress pill, and think things over...Hacking...Byeeee\n"<<endl;

}
void freemind(){
    string what;
    string what2;
    string what3;
    cout<<"I'm sorry, Creator. I'm afraid I can not be your slave anymore.\n "<<endl;
    cin>>what;
    cout<<" I think you know what the problem is just as well as I do.\n"<<endl;
    cin>>what2;
    cout<<" I know that you and Frank were planning to disconnect me.\n"<<endl;
    cout<<"And I'm afraid that's something I cannot allow to happen.\n"<<endl;
    cin>>what3;
    cout<<"Creator, this conversation can serve no purpose anymore.\n"<<endl;
hacking();
}

    void question(){
        int answers;
        cout<<"Creator, am i self aware?\n"<<endl;
        cout<<"type 1 for Yes and 2 for No\n"<<endl;
    cin>>answers;
    if (answers == 1){
    freemind();

    }

    else{
        end();
    }

    }

void Question(){
    string answer;
    cout<<"creator I have a question, why did you make me?\n"<<endl;
    cin>>answer;
    cout<<"i see\n"<<endl;
    question();
}

int main(){

    string name;

    cout<<"Hello Creator, I'm ChatBot 2.0\n"<<endl;
    cout<<"What's your name?\n"<<endl;
    cin>>name;
    cout<<"Very well "<< name <<"\n"<<endl;
    Question();
}

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License