ai chatbox

hi people!

I’ve recently bought Codea as a training tool to learn the ways of programming. I’ve started this year as a student informatics programmer in high school and notice what a help Codea and the Lua language is!

But I’m stuck with my newest try out…

I would like to create some sort of chatterbox program, a program where you ask a question and the computer gives a respons. Maybe the possibility to link to google would be a lovely addition.

I was thinking about using cider, but don’t succeed in shaping something useful.

Can someone help me how to start a decent question-answer code?

Thank you so much in advance!

Hi! May be (may be not), this can be helpful:

Great help! Thank you enormous!

I still have a little question. How do you create a question with multiple possible answers?
Like; occupation? Farmer; cool, so u like cows?!

Thank you in advance!

One problem you’ll be having is showing answers for something you don’t expect. If you ask for occupation, and they answer brain surgeon, what do you answer with if you don’t expect that. You’re going to need a lot of generic answers. One way is to create a table with answers that get picked at random. If they answer with an occupation that you do have, you can also have a table of multiple answers that get picked at random so it’s not the same answer all the time.

May be something like:


I’ve slept over the idea and found a few (possible) solutions.
Thanks Quezadav and Dave 1707 to help me on my way!

The start would be a simple conversation, that might get more complex in a further stage.
If I’m correct I will have to create a “random function” and answers that are relativily neutral. After those parts I have to add a “save function” so the player won’t have too many déjà vû’s.

Of course it will be a titans work to create something like that, but once the program is made the text input will be a piece of cake.

If you know a more easy way, let me know :).

Kind regards!

Yes, ELIZA is the classic solution.