It is possible that it is always going to the second while loop because of this:
[source lang="python"]if p < 15 and y == 1: game = False elect_new = True[/source]
(There is a weird glitch with this code block, if i use "p <= 15" it fails to display so assume it is "p <= 15" instead of "p < 15")
Is this code supposed to be evaluated every loop iteration?
What is the initial value of p? This code is evaluated every iteration and if p is initialized as <= 15 then this will evaluate true almost immediately because y is determined by:
[source lang="python"]y = random.randint(1, 3)[/source]
Which is also evaluated every loop and because the loop time is really fast, as in < 10ms (this may be faster because you have no sleep/fps timing), y will be 1 in about 3-4 loops. so it would take about 30-40ms to evaluate true and jump to the second loop.
The initial value of p is 50 and is changed according to x (as shown in the "game" loop). Yes it is supposed to be evaluated every loop because when i tried doing it otherwise it didn't work (x stayed one number the whole time).
Is it possible that the reason it refuses to return to the "game" loop from the "new_elect" loop because the "new_elect" loop is at a lower position in the text than the "game" loop? so by the time it sees to return to the "game" loop it can't?