' CONVERSE by Robert Jessop ' ' Press F5 to start the program. When you get bored say goodbye to quit. ' ' This is a simple conversation program with knowledge of a range of subjects. ' It's not going to pass the turing test but then it only took an hour and a ' bit to write! Use full words as it doesn't understand abbreviations. ' ' The knowledge is roughly based on me. It is probably more interesting to ' talk to though! You can add information to it by adding DATA statements ' to the end of the program. The first column is the keyword that it will ' look for. If that word or phrase is the longest known one typed in a ' sentence then it will reply with the sentence in the second column. The ' first DATA statement just contains a number. This is the total number of ' keyword/response pairs and you will have to change it if you add things. ' Input is converted to lower case so all keywords must be lower case. If ' you make any good personnalities or just add some useful knowledge please ' send it to me at robertj@flashmail.com DEFINT A-Z DIM number AS INTEGER READ number DIM stimulus(1 TO number) AS STRING DIM response(1 TO number) AS STRING FOR i = 1 TO number READ stimulus(i) READ response(i) NEXT i PRINT PRINT "CONVERSE by Robert Jessop" PRINT reply$ = "Hello." COLOR 11 PRINT reply$ COLOR 7 DO LINE INPUT said$ said$ = LCASE$(said$) rlen = 0 DO WHILE (rlen = 0) FOR i = 1 TO number IF (INSTR(said$, stimulus(i)) > 0) THEN IF (LEN(stimulus(i)) > rlen) THEN reply$ = response(i) rlen = LEN(stimulus(i)) END IF END IF NEXT i IF (rlen = 0 AND said$ = LCASE$(reply$)) THEN EXIT DO IF rlen = 0 THEN LET said$ = LCASE$(reply$) LOOP IF rlen = 0 THEN LET reply$ = "What's that? " COLOR 11 PRINT reply$ COLOR 7 LOOP WHILE (reply$ <> "Goodbye.") ' This is all of the knowledge held by this program. ' Amount of information. DATA 64 ' keyword | Reponse DATA "hello", "How are you?" DATA "quit", "Goodbye." DATA "exit", "Goodbye." DATA "bye","Goodbye." DATA "weather", "It's raining here." DATA "rain", "It was snowing last week." DATA "tony blair", "I think Tony's much better than John Major was." DATA "john major", "He was a pretty awful prime minister." DATA "music", "I like dance and trance best." DATA "trance", "Any song you can dance to is good." DATA "song", "I like 'Better off alone' by Alice Deejay." DATA "deejay", "She's a very good singer. Have you heard 'Back in my Life'?" DATA "back in my life", "I like it but it's not as good as her first song." DATA "what do you mean?", "I don't understand." DATA "read", "I'm reading Sphere by Michael Crichton at the moment." DATA "sphere", "Sphere is very good. It's about the discovery of a spacecraft from the future on the seabed." DATA "michael crichton", "He's a very good writer. Have you read Jurassic Park?" DATA "jurassic park", "The film of it was alright but no where near as good as the book is." DATA "writer", "I like Michael Crichton. The science in his books is very interesting and well written." DATA "dickens", "I've never really liked old classic novels." DATA "austen", "I don't read that sort of thing but I saw Pride and Prejudice on the tele." DATA "pride and prejudice", "The BBC version was OK but not good enough to make we want to read it." DATA "cinema", "I like going to see films. I saw Anna and the King last week." DATA "film", "I like all of the Star Wars films but the my best film is Braveheart." DATA "anna and the king", "It's better than I expected. It has very good acting and is very sad in places." DATA "star wars", "Best series of films ever. Episode 6 is the best. The Phantom Menace was a bit disappointing though." DATA "the phantom menace", "It was OK but was pretty average compared to the original trilogy." DATA "Braveheart", "Amazing film, The battles are very good and its long too." DATA "thank", "You're welcome." DATA "fine", "Good. What do you want to talk about?" DATA "ok", "Alright, what are you interested in?" DATA "how are you?", "What've you been up to lately?" DATA "your name", "I am called Rob." DATA "you called", "Rob." DATA "mel gibson", "He was very good as William Wallace. Good scottish, for an autrailian." DATA "titanic", "Good film. It was too predictable though. They should have left out the part in the 1990s." DATA "winslet", "I liked the scene in Titanic when Jack drew her..." DATA "cameron", "I like his films, lots of special effects usually. Have you seen Terminator?" DATA "terminator", "I thought the first film was the best. What else have you seen?" DATA "empire strikes", "I thought it was nice of George Lucas to let the empire win." DATA "george lucas", "He is God. He invented Star Wars." DATA "jedi", "The lightsabre duels are good. Did you know Darth Vader has six actors?" DATA "six actors", "The main one, the voice, the breathing, the stuntman, the one when he takes his helmet off and I've forgotten what the other one did." DATA "what's that? ", "I don't know about it." DATA "Vader", "Best evil character ever I reckon." DATA "cya", "Goodbye." DATA "your program", "I was written by Robert Jessop." DATA "programmed", "Robert Jessop programmed me." DATA "email","My programmer's address is robertj@flashmail.com" DATA "e-mail","My programmer's address is robertj@flashmail.com" DATA "web site","My programmer, Robert, has two sites, His homepage and the WP clan site." DATA "website","My programmer, Robert, has two sites, His homepage and the WP clan site." DATA "web page","My programmer, Robert, has two sites, His homepage and the WP clan site." DATA "internet site","My programmer, Robert, has two sites, His homepage and the WP clan site." DATA "has two sites","The URLs are www.btinternet.com/~jediboba and www.wpclan.co.uk." DATA "you're stupid","Why don't you try writing a better program then?" DATA "you are stupid","At least I can type fast!" DATA "wp clan","It is a Warcraft 2 Clan which Robert runs." DATA "warcraft","Very good game. The best real-time strategy I think." DATA "real-time strategy", "Robert is pretty good at it, but no match for the likes of Techie and Wicksman." DATA "techie","He's very fast and always attacks where it hurts the most. Best player I know." DATA "techie and wicksman","They're in a class of there own." DATA "wicksman","Wicksman is a good all round player and the Official Wireplay club captian." DATA "wicksman is a good all round", "But he's not quite as good as Techie though."