You can add your own chatbot library based on the simple version of the console.
The source code is as follows:
Using system; using system. collections. generic; using system. text; namespace object-oriented chatbot 1.0 {class program {static void main (string [] ARGs) {robot R1 = new robot (); r1.name = "I "; r1.eat (5); r1.sayhello (); While (true) {string STR = console. readline (); r1.speak (STR) ;}} class robot {public string name {Get; set;} private int fullevel {Get; set ;} // you know the degree of hunger, so it should be set as a private property. Public void sayhello () // you can speak {console. writeline ("\ t [robot] Hello, my name is {0}. Glad to meet you! ", Name);} public void eat (INT foodcount) {If (fullevel> 100) {return;} fullevel = fullevel + foodcount;} public void speak (string Str) {If (fullevel <= 0) {console. writeline ("\ t [robot] starved to death. Don't ask. I won't say it! "); Return;} If (Str. contains ("name") | Str. contains ("name") | Str. contains ("who") | Str. contains ("hello") {This. sayhello (); // method of the class to call another method of the same type} else if (Str. contains ("girlfriend") {console. writeline ("\ t [robot] younger, not considered! ");} Else if (Str. Contains (" CREATE ") {console. writeline (" \ t [Robot description] is created by the nebula. ");} Else if (Str. contains ("Tease ratio") {console. writeline ("\ t [robot] You are a copeat. Your family is copeat! ");} Else if (Str. contains ("Haha") {console. writeline ("\ t [robot] ");} else if (Str. contains ("... ") {Console. writeline (" \ t [robot ].... ");} Else if (Str. Contains (" wipe ") {console. writeline (" \ t [robot] What do you want to wipe? ");} Else {console. writeline (" \ t [robot] does not understand! ") ;}Fullevel --;}}}
Run: