2016-12-16 3 views
0

donc je suis médiocre lua, mais je ne faisais que jouer avec ceFiltre Blasphème Lua

local profanitywords = {"fuck", "shit", "ass"} -- a small list 
local input = io.read() 

for i,v in ipairs (profanitywords) do 
    if string.find(input:lower(), v) then 
     print("Profanity") 
    else 
     print("Not Profanity") 
    end 
end 

mais ce que je reçois dans la sortie est la suivante:

Output Image aussi, je suis en utilisant des studios zerobrane

et parfois quand j'entre différentes choses, ça ne marche pas du tout. Aidez-moi?

+2

Quelle sortie attendez-vous? –

Répondre

1
local profanity 
for i,v in ipairs (profanitywords) do 
    if string.find(input:lower(), v) then 
     profanity = true 
     break 
    end 
end 

if profanity then 
    print("Profanity") 
else 
    print("Not Profanity") 
end