So I decided to make an array visualizer in pygame, and I decided to program the basic visualizer.
Here is the code which is arranging the rectangles, but it doesn't work:
#other code
list = list(range(129))
random.shuffle(list)
#other code
ended = False
while not ended:
#other code
for i in range(len(list)):
x1 = i*15
y1 = 1080-list[i]*8
x2 = 15+i*15
y2 = 1080
pygame.draw.rect(screen, (255, 255, 255), pygame.Rect(x1, y1, x2, y2))
pygame.display.update()
Here is expectation vs reality