The goal is having random objects spawn on 3 positions once . the code works and looks like this but with more if statements and 3 small stataments:
if mainloop != 3:
if smallloop1 != 1:
if randomnumber == x:
object.goto(x, y)
mainloop += 1
smallloop += 1
the problem is that the if statement doesnt stop so multiple objects spawn
im also not getting any error messages
I tried changing the if statements to while loops which didnt change anything except having to stop them with the break command or using a list instead of a random number which made the thing more complicated and again didnt change anything
Thanks in advance
Edit: small reproducible example:
if bigloop < 1:
if mediumloop1 < 1:
if random1 == 1 or 2 or 3:
print("first loop")
bigloop += 1
mediumloop1 += 1
if random1 == 4 or 5 or 6:
print("first loop")
bigloop += 1
mediumloop1 += 1
The problem is that it prints "first loop" twice.