logicbot: if input =~ /who is (.*)'s father/ then r1,s = self.send("who had #{$1}"); if /(.*) and (.*) had/ =~ r1 then f1 = $1.to_s; f2 = $2.to_s; rf1,s = self.send("is #{f1} male?"); if rf1 =~ /Yes/ then response = "#{f1}" end; rf2,s = self.send("is #{f2} male?"); if rf2 =~ /Yes/ then response = "#{f2}" end; end; end logicbot: if input =~ /who is (.*)'s grandfather/ then r1,s = self.send("who is #{$1}'s father"); r2,s = self.send("who is #{r1}'s father"); response = r2; end logicbot: if input =~ /who did (.*) marry/ then response = self.send("what did #{$1} married") end logicbot: if input =~ /who did (.*) marry/ then grp1 = $1.to_s; if response =~ /don't know/ then response = self.send("who married #{grp1}?") end; end logicbot: if input =~ /who did (.* and .*) have/ then response = self.send("who did #{$1} had?") end logicbot: if response =~ / are include / then response.sub!(/ are /, ' ') end logicbot: if response =~ / is not include / then response.sub!(/ is /, ' do ') end