0

I need to make a frowning turtle face in python however I can't get the semi-circle arc like frown right, it's too big or not complete.

import turtle
t = turtle.Turtle(2)
t.speed(5)
t.forward(120)
t.left(105)
t.forward(130)
t.right(90)
t.forward(25)
t.right(80)
t.forward(140)
t.left(65)
t.forward(100)
t.right(30)
t.forward(30)
t.right(30)
t.forward(30)
t.right(70)
t.forward(30)
t.right(30)
t.forward(30)
t.right (20)
t.forward(80)
t.left(65)
t.forward(130)
t.right(90)
t.forward(25)
t.right(80)
t.forward(110)
t.left (105)
t.forward (160)
t.left(65)
t.forward(50)
t.right(90)
t.forward(25)
t.right(80)
t.forward(60)
t.left (105)
t.right(65)
t.forward(70)
t.right(90)
t.forward(25)
t.right(80)
t.forward(32)
t.left (55)
t.forward(60)
t.penup()
t.right(90)
t.forward(20)
t.pendown()
r = 15
t.circle(r)
t.penup()
t.left(90)
t.forward(10)
t.left(90)
t.forward(5)
t.pendown()
r = 2
t.circle(r)
t.penup()
t.right(90)
t.forward(10)
t.pendown()
r = 2
t.circle(r)
t.penup()
t.forward(5)
t.right(90)
t.forward(15)
t.pendown()
for x in range(180):
    t.forward(1)
    t.right(1)
t.left(90)

This is my code so far

cdlane
  • 40,441
  • 5
  • 32
  • 81
R S
  • 5
  • 1
  • 1
    Possible duplicate of: https://stackoverflow.com/questions/44493062/python-draw-a-angry-and-surprise-face – sean-7777 Apr 02 '22 at 16:55

2 Answers2

0

Rather than using an explicit loop, we can use the circle() method again to draw the frown. In this case we need to add the optional extent argument, and also learn what using positive and negative radii and extents does to circle().

Below is my example solution where I've tossed your initial airplane drawing just to focus on the face:

import turtle

t = turtle.Turtle()

# head
r = 15
t.right(90)
t.circle(r)

r = 2

# right eye
t.penup()
t.left(90)
t.forward(10)
t.left(90)
t.forward(5)
t.pendown()
t.circle(r)

# left eye
t.penup()
t.right(90)
t.forward(10)
t.right(90)
t.pendown()
t.circle(r)

# frown
r = 5
t.penup()
t.left(90)
t.backward(5)
t.right(90)
t.forward(10)
t.left(90)
t.circle(-r, 60)
t.pendown()
t.circle(-r, -120)

t.hideturtle()
turtle.done()
cdlane
  • 40,441
  • 5
  • 32
  • 81
0

You can use turtle.circle(radius , extent of arc) to make a semi-circle. For example:

turtle.circle(50 , 180)

This would make a semi circle of radius 50px. You can change the direction of the turtle accordingly to make the arc face down.

Eshaan Gupta
  • 614
  • 8
  • 25