#!/usr/bin/env Python2
# Coding=utf-8
Import Turtle as T
T.pensize (4)
T.hideturtle ()
T.colormode (255)
T.color ((255, 155, 192), "Pink")
T.setup (840, 500)
T.speed (10)
# nose
T.pu ()
T.goto (-100, 100)
T.PD ()
T.seth (-30)
T.begin_fill ()
A = 0.4
For I in range (120):
If 0 <= i < <= i < 90:
A = a + 0.08
T.lt (3) # Turn left 3 degrees
T.FD (a) # Walk forward a step
Else
A = a-0.08
T.LT (3)
T.FD (a)
T.end_fill ()
T.pu ()
T.seth (90)
T.FD (25)
T.seth (0)
T.FD (10)
T.PD ()
T.pencolor (255, 155, 192)
T.seth (10)
T.begin_fill ()
T.circle (5)
T.color (160, 82, 45)
T.end_fill ()
T.pu ()
T.seth (0)
T.FD (20)
T.PD ()
T.pencolor (255, 155, 192)
T.seth (10)
T.begin_fill ()
T.circle (5)
T.color (160, 82, 45)
T.end_fill ()
# Head
T.color ((255, 155, 192), "Pink")
T.pu ()
T.seth (90)
T.FD (41)
T.seth (0)
T.FD (0)
T.PD ()
T.begin_fill ()
T.seth (180)
T.circle (300,-30)
T.circle (100,-60)
T.circle (80,-100)
T.circle (150,-20)
T.circle (60,-95)
T.seth (161)
T.circle (-300, 15)
T.pu ()
T.goto (-100, 100)
T.PD ()
T.seth (-30)
A = 0.4
For I in range (60):
If 0 <= i < <= i < 90:
A = a + 0.08
T.lt (3) # Turn left 3 degrees
T.FD (a) # Walk forward a step
Else
A = a-0.08
T.LT (3)
T.FD (a)
T.end_fill ()
# Ear
T.color ((255, 155, 192), "Pink")
T.pu ()
T.seth (90)
T.FD (-7)
T.seth (0)
T.FD (70)
T.PD ()
T.begin_fill ()
T.seth (100)
T.circle (-50, 50)
T.circle (-10, 120)
T.circle (-50, 54)
T.end_fill ()
T.pu ()
T.seth (90)
T.FD (-12)
T.seth (0)
T.FD (30)
T.PD ()
T.begin_fill ()
T.seth (100)
T.circle (-50, 50)
T.circle (-10, 120)
T.circle (-50, 56)
T.end_fill ()
# eyes
T.color ((255, 155, 192), "white")
T.pu ()
T.seth (90)
T.FD (-20)
T.seth (0)
T.FD (-95)
T.PD ()
T.begin_fill ()
T.circle (15)
T.end_fill ()
T.color ("Black")
T.pu ()
T.seth (90)
T.FD (12)
T.seth (0)
T.FD (-3)
T.PD ()
T.begin_fill ()
T.circle (3)
T.end_fill ()
T.color ((255, 155, 192), "white")
T.pu ()
T.seth (90)
T.FD (-25)
T.seth (0)
T.FD (40)
T.PD ()
T.begin_fill ()
T.circle (15)
T.end_fill ()
T.color ("Black")
T.pu ()
T.seth (90)
T.FD (12)
T.seth (0)
T.FD (-3)
T.PD ()
T.begin_fill ()
T.circle (3)
T.end_fill ()
# cheek
T.color ((255, 155, 192))
T.pu ()
T.seth (90)
T.FD (-95)
T.seth (0)
T.FD (65)
T.PD ()
T.begin_fill ()
T.circle (30)
T.end_fill ()
# mouths
T.color (239, 69, 19)
T.pu ()
T.seth (90)
T.FD (15)
T.seth (0)
T.FD (-100)
T.PD ()
T.seth (-80)
T.circle (30, 40)
T.circle (40, 80)
# body
T.color ("Red", (255, 99, 71))
T.pu ()
T.seth (90)
T.FD (-20)
T.seth (0)
T.FD (-78)
T.PD ()
T.begin_fill ()
T.seth (-130)
T.circle (100, 10)
T.circle (300, 30)
T.seth (0)
T.FD (230)
T.seth (90)
T.circle (300, 30)
T.circle (100, 3)
T.color ((255, 155, 192), (255, 100, 100))
T.seth (-135)
T.circle (-80, 63)
T.circle (-150, 24)
T.end_fill ()
# hand
T.color ((255, 155, 192))
T.pu ()
T.seth (90)
T.FD (-40)
T.seth (0)
T.FD (-27)
T.PD ()
T.seth (-160)
T.circle (300, 15)
T.pu ()
T.seth (90)
T.FD (15)
T.seth (0)
T.FD (0)
T.PD ()
T.seth (-10)
T.circle (-20, 90)
T.pu ()
T.seth (90)
T.FD (30)
T.seth (0)
T.FD (237)
T.PD ()
T.seth (-20)
T.circle (-300, 15)
T.pu ()
T.seth (90)
T.FD (20)
T.seth (0)
T.FD (0)
T.PD ()
T.seth (-170)
T.circle (20, 90)
# feet
T.pensize (10)
T.color ((240, 128, 128))
T.pu ()
T.seth (90)
T.FD (-75)
T.seth (0)
T.FD (-180)
T.PD ()
T.seth (-90)
T.FD (40)
T.seth (-180)
T.color ("Black")
T.pensize (15)
T.FD (20)
T.pensize (10)
T.color ((240, 128, 128))
T.pu ()
T.seth (90)
T.FD (40)
T.seth (0)
T.FD (90)
T.PD ()
T.seth (-90)
T.FD (40)
T.seth (-180)
T.color ("Black")
T.pensize (15)
T.FD (20)
# tail
T.pensize (4)
T.color ((255, 155, 192))
T.pu ()
T.seth (90)
T.FD (70)
T.seth (0)
T.FD (95)
T.PD ()
T.seth (0)
T.circle (70, 20)
T.circle (10, 330)
T.circle (70, 30)
Draw a colored little piggy with Python