I suggest posting this to
codereview.stackexchange.com ; there are several things that could be improved. For example, you use a boolean variable
state
as the condition for your while loop, but then you never change the value of
state
, and end up having to break out of the loop with
break
. You also have a variable called
restart
which looks like it wants to be the loop condition, but it is not. The
continue
statement is not doing anything here, as it is at the end of the loop body, and loops always continue by default. —
Stef 23 secs ago