Routine Summary

Simulates a simple AI chatbot.





Variables Used

Str1, A

Calculator Compatibility




URL: United TI


:Disp "What is your pro","blem?
:Repeat Str1="Shut up
:Input ">",Str1
:">Can you say tha","t in a different","way?
:If A=1:">Can you explain ","in more detail, ","please?
:If not(A:">And how does tha","t make you feel?

A Chatbot is a type of AI which is able to simulate an intelligent conversation with a person. A typical conversation consists of the person asking the chatbot questions, and the chatbot giving relevant responses. The way the chatbot determines a response is by breaking down the person's statements into the individual words and phrases, and looking up an appropriate response in its database (where its "knowledge" is stored).

Obviously, the more sophisticated a chatbot is, the larger the database of words and phrases needs to be, and likewise the larger the chatbot logic will be. In our simple chatbot, there are only three phrases that the chatbot will say, and the phrases are determined purely by random chance.

When you type in a statement, the chatbot will respond back with its own statement. You can keep "talking" with the chatbot for however long you want, but all you need to type to have it quit is just "Shut up". Because the routine uses Str1, you should clean it up at the end of your program.


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