艺术

来源:互联网 发布:洛桑联邦理工学院 知m 编辑:程序博客网 时间:2024/06/09 17:50
import pygame, sys, randompygame.init()screen = pygame.display.set_mode([640, 480])screen.fill([255,255,255])for i in range (100):    width = random.randint(0, 250)    height = random.randint(0, 100)    top = random.randint(0, 400)    left = random.randint(0, 500)    pygame.draw.rect(screen, [0,0,0], [left, top, width, height], 1)pygame.display.flip()while True:    for event in pygame.event.get():        if event.type == pygame.QUIT:            sys.exit()

0 0