Is there a restart() function in luart?
To restart the game, I put all the code in a function, then when I run it, there are problems with the code because many variables have their old values. Frankly, if there was a function like restart(), my job would be much easier. 🙂
function start()
....
....
if ui.confirm("Do you want to play again ?", "Again") == "yes" then
sys.beep()
start()
elseif ui.confirm("Do you want to play again ?", "Again") == "no" then
sys.exit()
end
...
end
start()
In such an example code, everything starts again for the 2nd time, whereas I just want the program to restart(), so it will just reset all the variables and values.