I initially want to use it to draw ChatGPT Logo,

but it's too complicated. So I asked AI and it provides me with some codes.
Then I mess around with the code and manage to draw a Begal!! Yay!
---Grace
This commit is contained in:
grace-xing6 2024-08-29 14:51:38 -04:00
parent 2a54081936
commit c6b662a957
2 changed files with 42 additions and 20 deletions

View File

@ -1,22 +1,22 @@
from turtle import (
forward,
back,
left,
right,
penup,
pendown,
color,
)
import turtle
forward(100)
right(360 * 2 / 5)
forward(100)
right(360 * 2 / 5)
forward(100)
right(360 * 2 / 5)
forward(100)
right(360 * 2 / 5)
forward(100)
right(360 * 2 / 5)
def draw_loop(radius, angle):
""" Draw a single loop part of the interlocking design. """
for _ in range(2):
pen.circle(radius, angle)
pen.circle(radius // 2, angle * 5)
pen.circle(radius, angle)
input()
# Screen setup
turtle.bgcolor("lightblue")
pen = turtle.Turtle()
pen.speed(0)
pen.color("white")
# Drawing multiple loops
for _ in range(30):
draw_loop(50, 50) # Adjust the radius and angle as needed
pen.right(50) # Adjust the turning angle for interlocking
pen.hideturtle()
turtle.done()

22
drawinggrace.py Normal file
View File

@ -0,0 +1,22 @@
import turtle
def draw_loop(radius, angle):
""" Draw a single loop part of the interlocking design. """
for _ in range(2):
pen.circle(radius, angle)
pen.circle(radius // 2, angle * 5)
pen.circle(radius, angle)
# Screen setup
turtle.bgcolor("lightblue")
pen = turtle.Turtle()
pen.speed(0)
pen.color("white")
# Drawing multiple loops
for _ in range(30):
draw_loop(50, 50) # Adjust the radius and angle as needed
pen.right(50) # Adjust the turning angle for interlocking
pen.hideturtle()
turtle.done()