Hi!
I have a hangman game that is working but I was wondering if there was a better way to code the function that checks to see if the entire word has been found. Here is the code that works but is long…\
local t=#currentWord
if 3 == t and currentWord[1].isVisible == true and currentWord[2].isVisible == true and currentWord[3].isVisible == true then
winCondition()
print(“win”)
elseif 4 == t and currentWord[1].isVisible == true and currentWord[2].isVisible == true and currentWord[3].isVisible == true and currentWord[4].isVisible == true then
winCondition()
print(“win”)
elseif 5 == t and currentWord[1].isVisible == true and currentWord[2].isVisible == true and currentWord[3].isVisible == true and currentWord[4].isVisible == true and currentWord[5].isVisible == true then
winCondition()
print(“win”)
elseif 6 == t and currentWord[1].isVisible == true and currentWord[2].isVisible == true and currentWord[3].isVisible == true and currentWord[4].isVisible == true and currentWord[5].isVisible == true and currentWord[6].isVisible == true then
winCondition()
print(“win”)
elseif 7 == t and currentWord[1].isVisible == true and currentWord[2].isVisible == true and currentWord[3].isVisible == true and currentWord[4].isVisible == true and currentWord[5].isVisible == true and currentWord[6].isVisible == true and currentWord[7].isVisible == true then
winCondition()
print(“win”)
end
All input is appreaciated!!! [import]uid: 170524 topic_id: 31015 reply_id: 331015[/import]