I had a function which was returning "Match"
if all the facts are true (although I now seem to have broken it by fiddling around with my current predicament, but that's not my main question).
function dobMatch(x)
local result = "YearOfBirth" .. x .. "MonthOfBirth"
if (result:find("DayOfBirth")~= nil and result:find("MonthOfBirth")~= nil and result:find("YearOfBirth")~= nil) then
return "Match"
else
return nil
end
end
dobList = {dobMatch("DayOfBirth"), dobMatch("Day")}
print(#dobList)
My actual question, is that if I trying to say that any 2 of the facts result:find("DayOfBirth")~= nil and result:find("MonthOfBirth")~= nil and result:find("YearOfBirth")
rather than all 3.
Please bare in mind that my actual issue has 12 facts, of which 10 need to be true so it would be very long to iterate through all the combinations.
Thanks in advance for your help!
Bonus Round! (I misinterpreted my aim)
If I wanted to weight these facts differently, i.e. DayOfBirth is far more important than Month would I just change the 1 (in Nifim answer) to the value I want it weighted?