Within my code I have an embedded if statement which uses the else, however on the first if statement whenever I use else again for the highest if statement it just causes an error and I'm not sure why. Here is my code:
if challengeLength > enteredLength then if challengeString == enteredText then print("CORRECT") else enteredLength = enteredLength - 1 print("Incorrect") else -- This is the else that it causes an error on print("Done") end end
You put the end's in the wrong position, here is it fixed:
if challengeLength > enteredLength then if challengeString == enteredText then print("CORRECT") else enteredLength = enteredLength - 1 print("Incorrect") end--Correct placement of the end. else print("Done") end