randint wants integer values for the range

This commit is contained in:
Robin Dunn
2017-04-07 12:26:09 -07:00
parent f4e2104adc
commit 8c79e98b57

View File

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