Difference between revisions of "TI-BASIC:Chatbot"

From Learn @ Cemetech
Jump to navigationJump to search
(Initial automated import)
 
(Automated @@ correction)
 
Line 1: Line 1:
 
{{Template:TI-BASIC:Routine
 
{{Template:TI-BASIC:Routine
|picture=@@
+
|picture=
 
|summary=Simulates a simple AI chatbot.
 
|summary=Simulates a simple AI chatbot.
 
|input=None
 
|input=None
Line 7: Line 7:
 
|compatibility=TI-83/84/+/SE
 
|compatibility=TI-83/84/+/SE
 
|author=alexrudd
 
|author=alexrudd
|authors=@@
+
|authors=
 
|url=http://www.unitedti.org/index.php?showtopic=2438&view=findpost&p=44356 United TI
 
|url=http://www.unitedti.org/index.php?showtopic=2438&view=findpost&p=44356 United TI
 
|download=[file chatbot.zip]
 
|download=[file chatbot.zip]

Latest revision as of 22:10, 24 February 2016


Routine Summary

Simulates a simple AI chatbot.

Inputs

None

Outputs

None

Variables Used

Str1, A

Calculator Compatibility

TI-83/84/+/SE Author

alexruddURL: United TI Download

file chatbot.zip

:ClrHome
:Disp "What is your pro","blem?
:Repeat Str1="Shut up
:Input ">",Str1
:int(3rand→A
:">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?
:Output(1,1,Ans
:End

A [wikipedia:Chatterbot 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.