Help plz

About advanced scenes, and the Thyme scripting language used in Algodoo.

Help plz

Postby Ai Group 1 » Thu Nov 10, 2011 4:43 am

hey im making AI stuff
and i need to make it so that when you type something that the AI does NOT know a response to
it will say "..."
oh and check this OUT!
http://cleverbot.com/
Image
Ai Group 1
 
Posts: 10
Joined: Wed Oct 26, 2011 1:41 am

Re: Help plz

Postby Matten » Thu Nov 10, 2011 8:35 am

How does your AI work? The simplest code for something like this is: [input text] = [list of known words here] ? {react on known words}:{react on unknown words}. There are probably easier ways to do this, and with a proper AI you can have another system of checking stuff.
Cave Johnson wrote:Do you know who I am? I'm the man who's gonna burn your house down! With the lemons! I'm gonna get my engineers to invent a combustible lemon that burns your house down!
User avatar
Matten
 
Posts: 435
Joined: Mon Apr 05, 2010 2:03 pm
Location: The Netherlands

Re: Help plz

Postby KarateBrot » Thu Nov 10, 2011 2:04 pm

try this.

Code: Select all
scene.my.IsInList := (e, L)=>{
    check := false;
    for(string.length(L), (i)=>{check ? {} : {e == L(i) ? {check = true} : {}}});
    check
};

scene.my.answer := (word, list)=>{scene.my.isinlist(word, list) ? {} : {"..."}};


scene.my.isinlist checks if a specific word e is contained in a list of words L. if it is it will give the value "true" and if not it will give the value "false".
scene.my.answer then prints out "..." if scene.my.isinlist is "false"
Image
User avatar
KarateBrot
 
Posts: 825
Joined: Mon Aug 31, 2009 7:32 pm
Location: Germany


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 5 guests