From 310332eeea2bce98cf2c179b2e4e3ce24b440153 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B1=AA=E7=82=9C?= <1492985642@qq.com> Date: Sun, 2 Jun 2024 23:36:00 +0800 Subject: [PATCH] first commit --- sin.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 sin.py diff --git a/sin.py b/sin.py new file mode 100644 index 0000000..986060a --- /dev/null +++ b/sin.py @@ -0,0 +1,13 @@ +import pygame,sys +import math +pygame.init() +screen = pygame.display.set_mode([640,480]) +screen.fill([249,204,226]) +for x in range(0,640): + y = int(math.sin(x/640.0*4*math.pi)*200+240) + pygame.draw.rect(screen,[0,0,0],[x,y,1,1],1) +pygame.display.flip() +while True: + for event in pygame.event.get(): + if event.type == pygame.QUIT: + sys.exit()