Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / help with an ai program

Author
Message
forcemaster 99
20
Years of Service
User Offline
Joined: 4th May 2004
Location:
Posted: 4th May 2004 21:12
hi. i used to use qbasic and i once downloaded a program where i could type in a comment and it would answer me. i opend up the file and looked at the code. it used a combination of keywords and replies. i was wondering if there is a way to make a program like that, without having to use the IF...THEN command, in dark basic.
please can sum1 help me

I Play on my all the time.
zircher
21
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 4th May 2004 22:17
Shift the case of the search string to upper or lower case. Reduce the string to tokens. Either use SELECT/CASE to search a keyword list, or load your keywords into an array from a file and search the array via a loop.
--
TAZ

forcemaster 99
20
Years of Service
User Offline
Joined: 4th May 2004
Location:
Posted: 5th May 2004 16:06
could you please be a little more clear. i didnt really understand that.

I Play on my all the time.
GameKit
21
Years of Service
User Offline
Joined: 6th Mar 2003
Location: USA, Staring Blankly at a Computer
Posted: 5th May 2004 17:10
First... Think of and write down every possible thing that the user might say to the program, then write down what the computer would say back...

Then, using the Select Case Command, tell the computer to reply with certain sentances based on keywords or phrases that the user types in...

A project like this would take a long time to program... If you are new to DarkBASIC i'd recommend starting out with a simple pong game... There is a great tutorial "stickied" to the top of the posts called "My First Pong Game".

...Well...I hope I helped...

Previously known as "Game_Creator". Thou shalt not thwart the way of the dragon. For thou tasteth like chicken.
Peter H
20
Years of Service
User Offline
Joined: 20th Feb 2004
Location: Witness Protection Program
Posted: 5th May 2004 18:12
this would be what is called a "expert system" in the land of AI(at least i think so )...it doesn't actually understand what it's being told it just has a bunch of preprogrammed info that it responds with


Formerly known as "DarkWing Duck"
zircher
21
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 5th May 2004 19:20
If you can't figure out what I said, you're probably not ready to tackle the task. Here are many flavors of Eliza. Choose one and translate to DB.

http://www-2.cs.cmu.edu/afs/cs/project/ai-repository/ai/areas/classics/eliza/basic/
--
TAZ

forcemaster 99
20
Years of Service
User Offline
Joined: 4th May 2004
Location:
Posted: 6th May 2004 18:49
i still cant do it. could sum1 plez post an example of the source code to show me how to do it

I Play on my all the time.
zircher
21
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 6th May 2004 21:19
That's twice you have used 'sum1'. Perhaps you do not know the difference between a chat room and a forum? Exercise your brain.

Do you know how to make an array?
Do you know how to populate that array with keywords?
Do you know how to get user input?
Do you know how to walk thought a string of text and extract words?
Do you know how to use a for/next loop to search for matches?
Do you know how to print replies based on those matches?

This is not rocket science and this is very much QBasic level programming. You don't need the codez. You just need to read the manual/help files and apply what you have learned.
--
TAZ


(Yes, I know I'm a PITA. But, there's a method to the madness.)

forcemaster 99
20
Years of Service
User Offline
Joined: 4th May 2004
Location:
Posted: 7th May 2004 13:51
im sorry i wont use sum1 any more.
i dont know how to do any of those things except how to get a user input. and the built in tutorals absolutly suck.
but if you dont tell me how to do it il never learn.

I Play on my all the time.

Login to post a reply

Server time is: 2024-09-22 08:44:19
Your offset time is: 2024-09-22 08:44:19