> logicbot: if input =~ /if (.*) likes (.*), then (.*) also likes (.*)/i then self.send("#{$1} likes #{$2}"); self.send("#{$3} likes #{$4}"); response = "Okay" end Okay [...] > if Bess likes a girl, then Abby also likes her. Okay > Bess likes Cody Default response. > show a_r_b's api [show_one_method_api] grp1 == a_r_b. a_r_b | (.*) says (?:that )?(.*) a_r_b | (.*) means the same as (.*) a_r_b | (.*) means (.*) a_r_b | (.*) is the same as (.*) a_r_b | (.*) am (.*) a_r_b | (.*) are (.*) a_r_b | "(.*)" is "(.*)" a_r_b | (.*) was (.*) a_r_b | (.*) were (.*) a_r_b | (.*) is "(.*)" a_r_b | "(.*)" is (.*) a_r_b | (.*) is (.*) > show generic_a_r_b's api [show_one_method_api] grp1 == generic_a_r_b. generic_a_r_b | (.*) (wrote) (.*) generic_a_r_b | (.*) (knows) (.*) generic_a_r_b | (.*) (hit) (.*) generic_a_r_b | (.*) (is taller than) (.*) generic_a_r_b | (.*) (is funnier than) (.*) generic_a_r_b | (.*) (is greater than) (.*) generic_a_r_b | (.*) (is heavier than) (.*) generic_a_r_b | (.*) (is smaller than) (.*) generic_a_r_b | (.*) (are smaller than) (.*) generic_a_r_b | (.*) (is warmer than) (.*) generic_a_r_b | (.*) (is better than) (.*) generic_a_r_b | (.*) (is bigger than) (.*) generic_a_r_b | (.*) (is larger than) (.*) > (.*) (likes) (.*) is a synonym for (.*) (knows) (.*) Okay, (?i-mx:(.*) (likes) (.*)) has been added, and will now call generic_a_r_b. > show generic_is_a_r_b's api [show_one_method_api] grp1 == generic_is_a_r_b. generic_is_a_r_b | did (.*) (write) (.*) generic_is_a_r_b | does (.*) (know) (.*) generic_is_a_r_b | did (.*) (hit) (.*) generic_is_a_r_b | is (.*) (taller than) (.*) generic_is_a_r_b | is (.*) (funnier than) (.*) generic_is_a_r_b | is (.*) (greater than) (.*) generic_is_a_r_b | is (.*) (heavier than) (.*) generic_is_a_r_b | is (.*) (smaller than) (.*) generic_is_a_r_b | is (.*) (warmer than) (.*) generic_is_a_r_b | is (.*) (better than) (.*) generic_is_a_r_b | is (.*) (bigger than) (.*) generic_is_a_r_b | is (.*) (larger than) (.*) generic_is_a_r_b | is (.*) (.* than) (.*) > does (.*) (like) (.*) is a synonym for does (.*) (know) (.*) Okay, (?i-mx:does (.*) (like) (.*)) has been added, and will now call generic_is_a_r_b. > like == likes Okay, like = likes. > Does Abby like Cody? I have no knowledge that Abby is like Cody. > if response =~ / is like / then response.sub!(/ is like /, ' likes ') end Okay, (?-mix:^if response =~ ) has been added, and will now call . > logicbot: if response =~ / is like / then response.sub!(/ is like /, ' likes ' ) end Okay I have added if response =~ / is like / then response.sub!(/ is like /, ' likes ') end. > Bess likes Cody Okay, Bess likes Cody. > does Abby like Cody? I have no knowledge that Abby likes Cody. > Cody = a girl Okay, Cody = a girl. > does Abby like Cody? I have no knowledge that Abby likes Cody. > a girl == her Okay, a girl = her. > does Abby like Cody? I have no knowledge that Abby likes Cody. > logicbot: show rules if input =~ /\byour\b/i and response =~ /\byour\b/i then response.gsub!(/\byour\ b/i, "my") end if input =~ /\byour\b/i and response =~ /\bme\b/ then response.gsub!(/\bme\b/, " you") end if input =~ /\bI\b/i and response =~ /\bI\b/i then response.gsub!(/\bI\b/i, "you ") end if input =~ /\bI\b/i and response =~ /\byour\b/i then response.gsub!(/\byour\b/i , "my") end if input =~ /(.*) is who\?$/ then response = self.send("who is #{$1}") end if input =~ /\bmy\b/ then response.gsub!(/\bmy\b/, 'your') end if input =~ /^when is (.*)/ and score <= 3 then response = self.send("what is #{ $1}")[0]; score += 3 end if input =~ /if (.*) knows (.*), then (.*) knows (.*)/i then self.send("#{$1} kn ows #{$2}"); self.send("#{$2} knows #{$1}"); self.send("#{$3} knows #{$4}"); sel f.send("#{$4} knows #{$3}"); response = "Okay" end if response =~ / is know /i then response.sub!(/ is know /, ' knows ') end if input =~ /if (.*) likes (.*), then (.*) also likes (.*)/i then self.send("#{$ 1} likes #{$2}"); self.send("#{$3} likes #{$4}"); response = "Okay" end if response =~ / is like / then response.sub!(/ is like /, ' likes ') end > if Bess likes a girl, then Abby also likes her. Okay > Bess likes Cody Okay, Bess likes Cody. > does Bess like Cody? Yes, Bess likes Cody. > Does Abby like Cody? Yes, Abby likes Cody. >