Created
May 8, 2024 04:01
-
-
Save dtbao20/5e29b1c371e3a6e52a2344fdfb43e3cc to your computer and use it in GitHub Desktop.
cờ giải phóng
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from turtle import * | |
bgcolor("#f00"),setup(600,400,800,80) | |
hideturtle(), tracer(0), penup() | |
from math import sin, cos, pi | |
from time import perf_counter | |
def _30_4_1975(): | |
update(), clear() | |
t = perf_counter()*3 | |
goto(0,-9999), dot(9999*2, (0,0.5,1)) | |
color("#ff0") | |
begin_fill() | |
for i in range(401): | |
a = (i/400)*4*pi | |
R = 50/cos(a%(pi*4/5)-pi*4/5/2) | |
goto(R*cos(a+pi/2)+2*cos(t+R), R*sin(a+pi/2)+2*sin(t+R)) | |
end_fill() | |
ontimer(_30_4_1975, 10) | |
_30_4_1975() | |
mainloop() | |
# Ps: chỉ chạy đúng trên các phiên bản Python 3.11 trở xuống |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment