integer division for randint

Python 3.12 does not accept floats for random.randint() anymore
This commit is contained in:
Ben Greiner
2024-01-06 21:58:29 +01:00
committed by GitHub
parent 1f9b5f4996
commit 3b042c863f

View File

@@ -63,8 +63,8 @@ def makeRandomRectangles():
rects = []
for i in range(num):
W = random.randint(10, w/2)
H = random.randint(10, h/2)
W = random.randint(10, w//2)
H = random.randint(10, h//2)
x = random.randint(0, w - W)
y = random.randint(0, h - H)
rects.append( (x, y, W, H) )