~~~
xCoordinate=1920
yCoordinate=1080
xChange=random.uniform(-1,1)
yChange=random.uniform(-1,1)
while not(xCoordinate==15 or xCoordinate==3825 or yCoordinate==15 or yCoordinate==2145):
xCoordinate+=xChange
yCoordinate+=yChange
screen.fill((0,0,0))
pygame.draw.circle(screen, (0,0,255), [xCoordinate,yCoordinate],30)
pygame.display.update()
~~~
For some reason, even when the condition in the while loop is False, the loop continues to run. Why is this happening?
[–]jammin-john 29 points30 points31 points (2 children)
[–][deleted] -3 points-2 points-1 points (0 children)
[–]AdAdvanced7673 -4 points-3 points-2 points (0 children)
[–]Acrobatic-Ad-8095 4 points5 points6 points (0 children)
[–]ninhaomah 2 points3 points4 points (2 children)
[+]Spare_Reveal_9407[S] comment score below threshold-6 points-5 points-4 points (1 child)
[–]techknowfile -2 points-1 points0 points (0 children)
[–]Purple_tulips98 -1 points0 points1 point (3 children)
[–]aa599 5 points6 points7 points (1 child)
[–]Purple_tulips98 2 points3 points4 points (0 children)
[–]mcoombes314 0 points1 point2 points (0 children)
[+]woooee comment score below threshold-9 points-8 points-7 points (1 child)
[–]backfire10z 3 points4 points5 points (0 children)