Posted 02 December 2015 - 12:50 AM
I'm pretty new to all this coding and such and one thing I'm good at is if / else commands. One thing I've been dying to know is that how I could make something like this work (just an example):
Basically I want it to do something that if the input isn't y or n then it would let the user try again and input one of the options. How can I do this in the easiest way possible?
if input == "y" then
print("Hi")
sleep(2)
end
if input == "n" then
print("Bye")
sleep(2)
end
if input ~= "y" or if input ~= "n" then
--do nothing? how?nput = read()
Basically I want it to do something that if the input isn't y or n then it would let the user try again and input one of the options. How can I do this in the easiest way possible?