-7

I have an idea for a semi-AI code that has a separate ai.h and ai.cpp file that contain the massive AI program, but is it possible to update the code while, or before it runs ai again? This is the main.cpp so far

int main(){
    start:
    string value1 = "";
    cout << "Hello, I am AI, what do you need?\n";
    cin >> value1;
    cin.get();
    ai(value1);
    goto :start
}

For example the user could enter "update 'define' 'what is'", and then typing what is would do the same as typing define, but how would I make AI update itself?

Bryan Chen
  • 45,816
  • 18
  • 112
  • 143
user3117152
  • 94
  • 14
  • 4
    This question appears to be off-topic because OP should visit some CS classes before trying to implement genetic algorithms. – Kijewski Jul 26 '14 at 02:01

1 Answers1

3

As for an answer that you might be more happy with: Google "Prolog". You can change the knowledge base at runtime, which is not the same as a genetic algorithm, but more dynamic than your average Eliza. Also, since most Elizas are written in Prolog, you have a good starting point.

Of course, since your target language C++ is Turing complete you could implement all of Prolog's features yourself. Also you could stab yourself repeatedly in the eye with a rusty fork. Both things are same as intelligent.

Community
  • 1
  • 1
Kijewski
  • 25,517
  • 12
  • 101
  • 143