import pygame
import random
pygame.init()
window = pygame.display.set_mode((500, 500))
point = [(0,0), (250,500), (500,0)]
prevPoint = random.randint(0, 500), random.randint(0, 500)
while True:
    x1, y1 = prevPoint
    x2, y2 = point[random.randint(0, 2)]
    midPoint = ((x1 + x2) / 2, (y1 + y2) / 2)
    pygame.draw.circle(window, (255, 255, 255), midPoint, 0)
    pygame.display.flip()
    prevPoint = midPoint
