Changes

Jump to: navigation, search

Module:Yesno

43 bytes added, 06:12, 23 March 2013
fix bugs highlighted in Module talk:Yesno/testcases
val = args[1]
-- First deal with the case if val is nil or "¬", then deal with other cases. if val == nil or val == '¬' then
return retvals['¬']
end
if val == '' then
return retvals['blank'] or retvals['no']
elseif val == 'n' or val == 'no' or tonumber(val ) == '0' then
return retvals['no']
elseif val == 'y' or val == 'yes' or tonumber(val ) == '1' or retvals['def'] == nil then
return retvals['yes']
elseif val == '¬' then
return retvals['¬']
else
return retvals['def'] or retvals['yes']
end
end
return p
Anonymous user

Navigation menu