• Create Account

### #Actualslicksk8te

Posted 12 October 2012 - 11:13 AM

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.

### #8slicksk8te

Posted 12 October 2012 - 11:12 AM

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)

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.

### #7slicksk8te

Posted 12 October 2012 - 11:11 AM

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]

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.

### #6slicksk8te

Posted 12 October 2012 - 11:11 AM

It is possible that it is always going to the second while loop because of this:
[source lang="java"]if p <= 15 and y == 1: game = False elect_new = True[/source]

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.

### #5slicksk8te

Posted 12 October 2012 - 11:11 AM

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]

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.

### #4slicksk8te

Posted 12 October 2012 - 11:10 AM

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]
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.

PARTNERS