Posted 17 December 2012 - 10:50 AM
i = 1
fName = ""
fTable = ""
function needAName()
if fName == fTable[i] then
return true
else
return false
end
end
function is(fName,fTable)
for i = 1,#fTable do
if needAName() and fName == fTable[i] then
ball = true
else
ball = false
end
end
if ball == true then
return true
else
return false
end
end
word = {
"left",
"right",
"up",
"down",
"back",
"front"
}
One = io.read()
if is(One,word) then
print("correct!")
else
print(One.." is not a side.")
end
It's not returning an error, The problem is that when i type in left it says left is not a side.its supposed to check if fName is equal to any value in fTable and if it is then it will return true. But that's not the case I guess.