├── flag.png ├── designwithcircles.py ├── spiral fill desigb.py ├── octagonaldesign.py ├── ninjablade.py ├── rgbtubes.py ├── design with pentagons.py ├── trendy star.py ├── rainbow hexagon.py ├── 3ddesign.py ├── 3dspiraldesign.py ├── vibate circle.py ├── awesome rings.py ├── iglogo.py ├── vibateturtle.py ├── vibratespiral.py ├── levitating_squares.py ├── amazing_strings.py ├── Hypnotic spiral.py ├── Radar like animation.py ├── amazingstarusingturtle.py ├── color changing star.py ├── filling the screen with magenta design.py ├── ninjastar.py ├── ❤.py ├── heptagonal design.py ├── Olympic Rings.py ├── fractraltree.py ├── vibrate star.py ├── gitlogo.py ├── honey comb.py ├── penguin.py ├── Indian Flag.py ├── googlelogo.py ├── pokeball.py ├── ironman.py ├── amongus.py ├── githublogo.py ├── pythonlogo.py ├── rockstargamelogo.py ├── roglogo.py ├── amazingspiral.py ├── android logo.py ├── Captain America's Shield.py ├── neural network design.py ├── earth.py ├── transformer.py ├── pikachu.py └── spongebob.py /flag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NitulKalita/PythonTurtle/HEAD/flag.png -------------------------------------------------------------------------------- /designwithcircles.py: -------------------------------------------------------------------------------- 1 | import turtle as t 2 | 3 | t.bgcolor("black") 4 | t.speed(0) 5 | 6 | for i in range(800): 7 | t.circle(i+12) 8 | t.left(71/1.2) 9 | t.pencolor("white") 10 | 11 | t.done() -------------------------------------------------------------------------------- /spiral fill desigb.py: -------------------------------------------------------------------------------- 1 | 2 | import turtle as t 3 | 4 | t.bgcolor("black") 5 | t.speed(0) 6 | t.width(2) 7 | 8 | t.pencolor("blue") 9 | 10 | x = 1 11 | 12 | while x < 5000: 13 | t.forward(x) 14 | t.right(88) 15 | x += 2 -------------------------------------------------------------------------------- /octagonaldesign.py: -------------------------------------------------------------------------------- 1 | import turtle as t 2 | t.speed(10) 3 | t.bgcolor("black") 4 | t.color("yellow") 5 | t.pensize(5) 6 | for i in range(8): 7 | t.left(45) 8 | for i in range(8): 9 | t.forward(100) 10 | t.right(45) 11 | 12 | t.done() -------------------------------------------------------------------------------- /ninjablade.py: -------------------------------------------------------------------------------- 1 | import turtle as t 2 | 3 | t.bgcolor("black") 4 | t.pencolor("white") 5 | t.speed(0) 6 | 7 | for i in range(150): 8 | for j in range(6): 9 | t.forward(i) 10 | t.left(46) 11 | t.hideturtle() 12 | t.left(33) 13 | t.done() -------------------------------------------------------------------------------- /rgbtubes.py: -------------------------------------------------------------------------------- 1 | import turtle as t 2 | 3 | t.speed(0) 4 | t.pensize(2) 5 | colors = ['red', 'green', 'blue'] 6 | for i in range(200): 7 | t.color(colors[i%3]) 8 | t.forward(i) 9 | t.circle(60) 10 | t.penup() 11 | t.left(60) 12 | t.pendown() 13 | t.left(200) 14 | t.right(200) 15 | 16 | t.done() -------------------------------------------------------------------------------- /design with pentagons.py: -------------------------------------------------------------------------------- 1 | import turtle as t 2 | 3 | t.bgcolor('black') 4 | colors =('cyan','red','blue','violet') 5 | t.speed(0) 6 | for i in range(60): 7 | t.pencolor(colors[i%4]) 8 | t.width(2) 9 | t.forward(i) 10 | t.circle(90,steps=5) 11 | t.forward(i) 12 | t.right(45) 13 | t.hideturtle() 14 | t.done() -------------------------------------------------------------------------------- /trendy star.py: -------------------------------------------------------------------------------- 1 | import turtle as t 2 | 3 | t.speed(10) 4 | t.bgcolor("black") 5 | colors = ("cyan", "blue", "yellow", "green") 6 | c=0 7 | for i in range(110): 8 | t.pensize(2) 9 | t.forward(i*5) 10 | t.right(144) 11 | t.color(colors[c]) 12 | if c==3: 13 | c=0 14 | else: 15 | c+=1 16 | t.done() -------------------------------------------------------------------------------- /rainbow hexagon.py: -------------------------------------------------------------------------------- 1 | import turtle 2 | 3 | turtle.bgcolor("black") 4 | colors=['violet', '#4b0082', 'green', 'blue', 'yellow', 'orange', 'red'] 5 | turtle.speed(0) 6 | 7 | for i in range(280): 8 | turtle.pencolor(colors[i%7]) 9 | turtle.pensize(2) 10 | turtle.forward(i) 11 | turtle.left(59) 12 | 13 | turtle.done() 14 | 15 | -------------------------------------------------------------------------------- /3ddesign.py: -------------------------------------------------------------------------------- 1 | import turtle as t 2 | 3 | t.bgcolor("black") 4 | colors = ['red','purple','blue','green'] 5 | t.speed(0) 6 | 7 | x=30 8 | y=0 9 | 10 | while True: 11 | t.circle(x) 12 | t.pencolor(colors[y % 4]) 13 | t.forward(x) 14 | t.right(90) 15 | 16 | x+=1 17 | y+=1 18 | 19 | if y == 100: 20 | break 21 | t.done() -------------------------------------------------------------------------------- /3dspiraldesign.py: -------------------------------------------------------------------------------- 1 | import turtle as t 2 | from random import randint 3 | 4 | t.bgcolor("black") 5 | t.speed(0) 6 | 7 | x=1 8 | 9 | while x<400: 10 | r=randint(0,255) 11 | g=randint(0,255) 12 | b=randint(0,255) 13 | t.colormode(255) 14 | t.pencolor(r,g,b) 15 | 16 | t.forward(x+5) 17 | t.right(90.99) 18 | x=x+1 19 | 20 | t.done() -------------------------------------------------------------------------------- /vibate circle.py: -------------------------------------------------------------------------------- 1 | import turtle 2 | 3 | t=turtle.Turtle() 4 | s=turtle.Screen() 5 | s.bgcolor("black") 6 | t.pencolor("blue") 7 | t.penup() 8 | t.goto(0,200) 9 | t.pendown() 10 | 11 | a=0 12 | b=0 13 | while True: 14 | t.forward(a) 15 | t.right(b) 16 | a+=3 17 | b+=1 18 | if b== 210: 19 | break 20 | turtle.hideturtle() 21 | 22 | turtle.done() -------------------------------------------------------------------------------- /awesome rings.py: -------------------------------------------------------------------------------- 1 | import turtle as t 2 | 3 | COLORS = ['black', 'magenta', 'pink', 'blue', 'green', 'yellow', 'orange', 'red'] 4 | 5 | t.width(6) 6 | t.speed(0) 7 | 8 | for color in COLORS: 9 | t.fillcolor(color) 10 | t.begin_fill() 11 | t.circle(145) 12 | t.circle(130, -360) 13 | t.circle(115) 14 | t.circle(100, -360) 15 | t.end_fill() 16 | t.right(45) 17 | 18 | t.hideturtle() 19 | t.done() -------------------------------------------------------------------------------- /iglogo.py: -------------------------------------------------------------------------------- 1 | import turtle as t 2 | 3 | t.bgpic("ig_background.png") 4 | t.pencolor("white") 5 | t.width(23) 6 | t.penup() 7 | t.goto(160,-100) 8 | t.pendown() 9 | t.left(90) 10 | 11 | for i in range(4): 12 | t.forward(250) 13 | t.circle(34,90) 14 | 15 | t.penup() 16 | t.goto(85,30) 17 | t.pendown() 18 | 19 | t.circle(80) 20 | t.penup() 21 | t.goto(110,130) 22 | t.pendown() 23 | t.circle(7) 24 | t.hideturtle() 25 | 26 | t.done() -------------------------------------------------------------------------------- /vibateturtle.py: -------------------------------------------------------------------------------- 1 | import turtle 2 | 3 | t=turtle.Turtle() 4 | t.pencolor("green") 5 | 6 | s= turtle.Screen() 7 | s.bgcolor("black") 8 | 9 | t.penup() 10 | t.goto(0,200) 11 | t.pendown() 12 | a=0 13 | b=0 14 | 15 | t.speed(0) 16 | 17 | while True: 18 | t.forward(a) 19 | t.right(b) 20 | a+=3 21 | b+=1 22 | if b== 210: 23 | break 24 | turtle.hideturtle() 25 | 26 | 27 | turtle.done() -------------------------------------------------------------------------------- /vibratespiral.py: -------------------------------------------------------------------------------- 1 | import turtle as t 2 | 3 | t.bgcolor("black") 4 | t.pencolor("yellow") 5 | t.speed(0) 6 | 7 | def shape (angle,side,lim): 8 | rev_dir = 200 9 | t.forward(side) 10 | 11 | if side % (rev_dir*2) == 0: 12 | angle = angle +2 13 | t.right(angle) 14 | side = side + 2 15 | if side < lim: 16 | shape(angle,side,lim) 17 | 18 | angle = 119 19 | side = 0 20 | lim = 600 21 | shape(angle,side,lim) 22 | t.done() -------------------------------------------------------------------------------- /levitating_squares.py: -------------------------------------------------------------------------------- 1 | import turtle as t 2 | 3 | colors = ['red', 'blue', 'indigo','green', 'yellow', 'violet', 'orange'] 4 | t.speed(0) 5 | a = 300 6 | for i in range(16): 7 | t.color(colors[i%7]) 8 | t.begin_fill() 9 | for i in range(4): 10 | t.forward(a) 11 | t.right(90) 12 | t.forward(a) 13 | t.right(90) 14 | t.forward(a-10) 15 | t.right(90) 16 | t.forward(a) 17 | t.end_fill() 18 | a-=20 19 | t.done() -------------------------------------------------------------------------------- /amazing_strings.py: -------------------------------------------------------------------------------- 1 | import turtle as t 2 | 3 | t.bgcolor("black") 4 | t.speed(0) 5 | t.pensize(2) 6 | 7 | colors = ['red', 'orange', 'green', 'indigo', 'blue', 'yellow'] 8 | 9 | a=0 10 | 11 | for i in range(36): 12 | t.color(colors[i%6]) 13 | for i in range(6): 14 | t.circle(10,180) 15 | t.left(180) 16 | t.circle(10,-180) 17 | t.left(180) 18 | t.penup() 19 | t.setpos(0,0) 20 | t.pendown() 21 | a+=10 22 | t.seth(a) 23 | t.done() -------------------------------------------------------------------------------- /Hypnotic spiral.py: -------------------------------------------------------------------------------- 1 | import turtle as t 2 | t.bgcolor('black') 3 | t.speed(60) 4 | t.pensize(1) 5 | colors = ('cyan','red') 6 | for i in range (200): 7 | t.forward(i*4) 8 | t.right(91) 9 | t.color(colors[i%5]) 10 | for x in range (3): 11 | t.forward(x*4) 12 | t.right(91) 13 | for a in range (2): 14 | t.forward(a*4) 15 | t.right(91) 16 | for m in range (739): 17 | t.forward(m*4) 18 | t.right(89) 19 | -------------------------------------------------------------------------------- /Radar like animation.py: -------------------------------------------------------------------------------- 1 | import turtle as t 2 | t.bgcolor('black') 3 | t.speed(60) 4 | t.pensize(1) 5 | colors = ('blue','red') 6 | for i in range (200): 7 | t.forward(i*4) 8 | t.right(91) 9 | t.color(colors[i%5]) 10 | for x in range (3): 11 | t.forward(x*4) 12 | t.right(91) 13 | for a in range (2): 14 | t.forward(a*4) 15 | t.right(91) 16 | for m in range (739): 17 | t.forward(m*4) 18 | t.right(899) -------------------------------------------------------------------------------- /amazingstarusingturtle.py: -------------------------------------------------------------------------------- 1 | import turtle as t 2 | 3 | t.penup() 4 | t.goto(-200,50) 5 | t.pendown() 6 | t.color("yellow") 7 | t.bgcolor("black") 8 | t.speed("fastest") 9 | 10 | def star(turtle,size): 11 | if size <=10: 12 | return 13 | else: 14 | turtle.begin_fill() 15 | for i in range(5): 16 | turtle.forward(size) 17 | star(turtle, size / 3) 18 | turtle.left(216) 19 | turtle.end_fill() 20 | 21 | star(t,360) 22 | t.done() -------------------------------------------------------------------------------- /color changing star.py: -------------------------------------------------------------------------------- 1 | import turtle as t 2 | 3 | t.bgcolor("black") 4 | t.speed(0) 5 | t.pensize(2) 6 | colors = ['red', 'yellow', 'blue', 'purple', 'green', 'pink', 'black','white'] 7 | 8 | distance = 170 9 | t.hideturtle() 10 | 11 | for color in colors: 12 | t.color(color) 13 | for j in range(8): 14 | t.left(45) 15 | for i in range(2): 16 | t.forward(distance) 17 | t.left(60) 18 | t.forward(distance) 19 | t.left(120) 20 | 21 | t.done() -------------------------------------------------------------------------------- /filling the screen with magenta design.py: -------------------------------------------------------------------------------- 1 | import turtle as t 2 | t.bgcolor('black') 3 | t.speed(60) 4 | t.pensize(1) 5 | colors = ('magenta') 6 | for i in range (200): 7 | t.forward(i*4) 8 | t.right(91) 9 | t.color(colors) 10 | for x in range (3): 11 | t.forward(x*4) 12 | t.right(91) 13 | for a in range (2): 14 | t.forward(a*4) 15 | t.right(91) 16 | for m in range (739): 17 | t.forward(m*4) 18 | t.right(891) -------------------------------------------------------------------------------- /ninjastar.py: -------------------------------------------------------------------------------- 1 | import turtle as t 2 | 3 | t.bgcolor("black") 4 | t.speed(0) 5 | t.pensize(2) 6 | colors = ['yellow','red', 'green', 'blue', 'orange', 'violet', 'green'] 7 | 8 | distance = 170 9 | 10 | for color in colors: 11 | t.color(color) 12 | for j in range(8): 13 | t.left(45) 14 | for i in range(2): 15 | t.forward(distance) 16 | t.left(60) 17 | t.forward(distance) 18 | t.left(120) 19 | distance = distance - 20 20 | 21 | t.hideturtle() 22 | t.done() -------------------------------------------------------------------------------- /❤.py: -------------------------------------------------------------------------------- 1 | import turtle as t 2 | 3 | t.pensize(2) 4 | t.speed("fastest") 5 | 6 | def curve(): 7 | for i in range(200): 8 | t.right(1) 9 | t.forward(1) 10 | 11 | def heart(): 12 | t.fillcolor('red') 13 | t.begin_fill() 14 | t.left(140) 15 | t.forward(113) 16 | curve() 17 | t.left(120) 18 | curve() 19 | t.forward(112) 20 | t.end_fill() 21 | 22 | heart() 23 | 24 | 25 | t.penup() 26 | t.goto(-25,89) 27 | t.pendown() 28 | t.write("godzilla") 29 | 30 | 31 | 32 | t.ht() 33 | t.done() -------------------------------------------------------------------------------- /heptagonal design.py: -------------------------------------------------------------------------------- 1 | import turtle as t 2 | t.speed(0) 3 | t.bgcolor('black') 4 | t.left(90) 5 | t.forward(60) 6 | t.right(90) 7 | color=('red','blue','green','yellow','cyan','white','brown','violet','indigo') 8 | for i in range(120): 9 | t.fillcolor(color[i%7]) 10 | t.begin_fill() 11 | t.pencolor('black') 12 | t.forward(i) 13 | t.right(12) 14 | t.forward(i) 15 | t.circle(-40,50) 16 | t.right(30) 17 | t.left(30) 18 | t.right(30) 19 | t.backward(i) 20 | t.left(400) 21 | t.end_fill() 22 | t.done() -------------------------------------------------------------------------------- /Olympic Rings.py: -------------------------------------------------------------------------------- 1 | import turtle as t 2 | 3 | t.pensize(5) 4 | 5 | t.color("blue") 6 | t.penup() 7 | t.goto(-110, -25) 8 | t.pendown() 9 | t.circle(45) 10 | 11 | t.color("black") 12 | t.penup() 13 | t.goto(0, -25) 14 | t.pendown() 15 | t.circle(45) 16 | 17 | t.color("red") 18 | t.penup() 19 | t.goto(110, -25) 20 | t.pendown() 21 | t.circle(45) 22 | 23 | t.color("yellow") 24 | t.penup() 25 | t.goto(-55, -75) 26 | t.pendown() 27 | t.circle(45) 28 | 29 | t.color("green") 30 | t.penup() 31 | t.goto(55, -75) 32 | t.pendown() 33 | t.circle(45) 34 | 35 | t.done() -------------------------------------------------------------------------------- /fractraltree.py: -------------------------------------------------------------------------------- 1 | import turtle as t 2 | 3 | t.speed("fastest") 4 | t.bgcolor("black") 5 | t.pensize(2) 6 | 7 | def tree(branchLen,t): 8 | if branchLen > 4: 9 | t.forward(branchLen) 10 | t.right(20) 11 | tree(branchLen-15,t) 12 | t.left(40) 13 | tree(branchLen-15,t) 14 | t.right(20) 15 | t.backward(branchLen) 16 | 17 | def main(): 18 | myWin = t.Screen() 19 | t.left(90) 20 | t.up() 21 | t.backward(200) 22 | t.down() 23 | t.color("green") 24 | tree(105,t) 25 | myWin.exitonclick() 26 | 27 | main() -------------------------------------------------------------------------------- /vibrate star.py: -------------------------------------------------------------------------------- 1 | import turtle as t 2 | import random 3 | 4 | t.speed('fastest') 5 | 6 | def draw(n, x, angle): 7 | for i in range(n): 8 | t.colormode(255) 9 | a = random.randint(0, 255) 10 | b = random.randint(0, 255) 11 | c = random.randint(0, 255) 12 | t.pencolor(a, b, c) 13 | t.fillcolor(a, b, c) 14 | t.begin_fill() 15 | for j in range(5): 16 | t.forward(5 * n-5 * i) 17 | t.right(x) 18 | t.forward(5 * n-5 * i) 19 | t.right(72 - x) 20 | t.end_fill() 21 | t.rt(angle) 22 | n = 30 23 | x = 144 24 | angle = 18 25 | 26 | draw(n, x, angle) 27 | t.done() -------------------------------------------------------------------------------- /gitlogo.py: -------------------------------------------------------------------------------- 1 | import turtle as t 2 | 3 | t.penup() 4 | t.goto(-20,230) 5 | t.pendown() 6 | t.left(45) 7 | 8 | t.begin_fill() 9 | t.fillcolor("#F1502F") 10 | for j in range(4): 11 | for i in range(45): 12 | t.right(2) 13 | t.forward(1) 14 | t.forward(300) 15 | t.end_fill() 16 | 17 | t.penup() 18 | t.goto(-70,180) 19 | t.pendown() 20 | t.pensize(20) 21 | t.pencolor("white") 22 | t.right(90) 23 | t.forward(100) 24 | t.pensize(50) 25 | t.forward(1) 26 | t.pensize(20) 27 | t.forward(130) 28 | t.pensize(50) 29 | t.forward(1) 30 | t.penup() 31 | t.goto(0,100) 32 | t.pendown() 33 | t.right(45) 34 | t.pensize(20) 35 | t.forward(200) 36 | t.pensize(50) 37 | t.forward(1) 38 | t.hideturtle() 39 | t.done() -------------------------------------------------------------------------------- /honey comb.py: -------------------------------------------------------------------------------- 1 | import turtle as t 2 | from random import randint 3 | size = 20 4 | circles = 20 5 | t.speed(100) 6 | 7 | t.colormode(255) 8 | 9 | def move(length, angle): 10 | t.right(angle) 11 | t.forward(length) 12 | 13 | def hex(): 14 | t.pendown() 15 | t.color( randint(0,255),randint(0,255),randint(0,255) ) 16 | t.begin_fill() 17 | for i in range(6): 18 | move(size,-60) 19 | t.end_fill() 20 | t.penup() 21 | t.penup() 22 | 23 | for circle in range (circles): 24 | if circle == 0: 25 | hex() 26 | move(size,-60) 27 | move(size,-60) 28 | move(size,-60) 29 | move(0,180) 30 | for i in range (6): 31 | move(0,60) 32 | for j in range (circle+1): 33 | hex() 34 | move(size,-60) 35 | move(size,60) 36 | move(-size,0) 37 | move(-size,60) 38 | move(size,-120) 39 | move(0,60) 40 | 41 | turtle.exitonclick() -------------------------------------------------------------------------------- /penguin.py: -------------------------------------------------------------------------------- 1 | import turtle as t 2 | 3 | t.setheading(270) 4 | t.begin_fill() 5 | t.circle(50,180) 6 | t.forward(80) 7 | t.circle(50,180) 8 | t.forward(80) 9 | t.end_fill() 10 | 11 | t.fillcolor("white") 12 | t.goto(10,0) 13 | t.begin_fill() 14 | t.circle(40) 15 | t.end_fill() 16 | 17 | t.setheading(0) 18 | t.goto(30,80) 19 | t.begin_fill() 20 | t.circle(20) 21 | t.end_fill() 22 | 23 | t.goto(70,80) 24 | t.begin_fill() 25 | t.circle(20) 26 | t.end_fill() 27 | 28 | t.shape("circle") 29 | t.fillcolor("black") 30 | t.penup() 31 | t.goto(30,100) 32 | t.stamp() 33 | t.goto(70,100) 34 | t.stamp() 35 | 36 | t.setheading(270) 37 | t.shape("triangle") 38 | t.fillcolor("orange") 39 | t.goto(50,70) 40 | t.stamp() 41 | 42 | t.setheading(0) 43 | t.fillcolor("black") 44 | t.pencolor("white") 45 | t.goto(0,50) 46 | t.stamp() 47 | t.setheading(180) 48 | t.goto(100,50) 49 | t.stamp() 50 | 51 | t.shape("square") 52 | t.fillcolor("orange") 53 | t.goto(35,-50) 54 | t.stamp() 55 | t.goto(65,-50) 56 | t.stamp() 57 | 58 | t.done() -------------------------------------------------------------------------------- /Indian Flag.py: -------------------------------------------------------------------------------- 1 | import turtle as t 2 | 3 | t.penup() 4 | t.goto(-400, 250) 5 | t.pendown() 6 | t.bgpic("flag.png") 7 | t.color("#FF9933") 8 | t.begin_fill() 9 | t.forward(800) 10 | t.right(90) 11 | t.forward(167) 12 | t.right(90) 13 | t.forward(800) 14 | t.end_fill() 15 | t.penup() 16 | t.left(90) 17 | t.forward(167) 18 | t.pendown() 19 | 20 | t.color("green") 21 | t.begin_fill() 22 | t.forward(167) 23 | t.left(90) 24 | t.forward(800) 25 | t.left(90) 26 | t.forward(167) 27 | t.end_fill() 28 | 29 | t.penup() 30 | t.goto(70, 0) 31 | t.pendown() 32 | t.color("navy") 33 | t.begin_fill() 34 | t.circle(70) 35 | t.end_fill() 36 | 37 | t.penup() 38 | t.goto(60, 0) 39 | t.pendown() 40 | t.color("white") 41 | t.begin_fill() 42 | t.circle(60) 43 | t.end_fill() 44 | 45 | t.penup() 46 | t.goto(-57, -8) 47 | t.pendown() 48 | t.color("navy") 49 | 50 | for i in range(24): 51 | t.begin_fill() 52 | t.circle(3) 53 | t.end_fill() 54 | t.penup() 55 | t.forward(15) 56 | t.right(15) 57 | t.pendown() 58 | 59 | t.penup() 60 | t.goto(20, 0) 61 | t.pendown() 62 | t.begin_fill() 63 | t.circle(20) 64 | t.end_fill() 65 | 66 | t.penup() 67 | t.goto(0, 0) 68 | t.pendown() 69 | t.pensize(2) 70 | 71 | for i in range(24): 72 | t.forward(60) 73 | t.backward(60) 74 | t.left(15) 75 | 76 | t.done() -------------------------------------------------------------------------------- /googlelogo.py: -------------------------------------------------------------------------------- 1 | import turtle as t 2 | 3 | t.color("#4285F4", "#4285F4") 4 | t.pensize(5) 5 | 6 | t.forward(120) 7 | t.right(90) 8 | t.circle(-150, 50) 9 | t.color("#0F9D58") 10 | t.circle(-150, 100) 11 | t.color("#F4B400") 12 | t.circle(-150, 60) 13 | t.color("#DB4437", "#DB4437") 14 | t.begin_fill() 15 | t.circle(-150, 100) 16 | t.right(90) 17 | t.forward(50) 18 | t.right(90) 19 | t.circle(100, 100) 20 | t.right(90) 21 | t.forward(50) 22 | t.end_fill() 23 | t.begin_fill() 24 | t.color("#F4B400", "#F4B400") 25 | t.right(180) 26 | t.forward(50) 27 | t.right(90) 28 | t.circle(100, 60) 29 | t.right(90) 30 | t.forward(50) 31 | t.right(90) 32 | t.circle(-150, 60) 33 | t.end_fill() 34 | t.right(90) 35 | t.forward(50) 36 | t.right(90) 37 | t.circle(100, 60) 38 | t.color("#0F9D58", "#0F9D58") 39 | t.begin_fill() 40 | t.circle(100, 100) 41 | t.right(90) 42 | t.forward(50) 43 | t.right(90) 44 | t.circle(-150, 100) 45 | t.right(90) 46 | t.forward(50) 47 | t.end_fill() 48 | t.right(90) 49 | t.circle(100, 100) 50 | t.color("#4285F4", "#4285F4") 51 | t.begin_fill() 52 | t.circle(100, 25) 53 | t.left(115) 54 | t.forward(65) 55 | t.right(90) 56 | t.forward(42) 57 | t.right(90) 58 | t.forward(124) 59 | t.right(90) 60 | t.circle(-150, 50) 61 | t.right(90) 62 | t.forward(50) 63 | t.end_fill() 64 | 65 | t.hideturtle() 66 | t.done() -------------------------------------------------------------------------------- /pokeball.py: -------------------------------------------------------------------------------- 1 | import turtle as t 2 | 3 | t.penup() 4 | t.goto(0,-190) 5 | t.pendown() 6 | t.speed(0) 7 | 8 | def curve1(): 9 | for i in range(180): 10 | t.right(1) 11 | t.forward(3) 12 | 13 | def curve2(): 14 | for i in range(180): 15 | t.left(1) 16 | t.forward(1.2) 17 | 18 | def curve(): 19 | t.begin_fill() 20 | t.fillcolor("red") 21 | curve1() 22 | t.right(90) 23 | t.forward(106) 24 | t.right(90) 25 | curve2() 26 | t.right(90) 27 | t.forward(102) 28 | t.end_fill() 29 | 30 | def curve3(): 31 | t.begin_fill() 32 | t.fillcolor("white") 33 | curve1() 34 | t.right(90) 35 | t.forward(106) 36 | t.right(90) 37 | curve2() 38 | t.right(90) 39 | t.forward(102) 40 | t.end_fill() 41 | 42 | 43 | t.begin_fill() 44 | t.fillcolor("black") 45 | t.circle(200) 46 | t.end_fill() 47 | 48 | t.pencolor("white") 49 | t.penup() 50 | t.goto(0,-40) 51 | t.pendown() 52 | t.begin_fill() 53 | t.fillcolor("white") 54 | t.circle(50) 55 | t.end_fill() 56 | 57 | t.pencolor("black") 58 | t.penup() 59 | t.goto(0,-10) 60 | t.pendown() 61 | t.circle(20) 62 | 63 | t.penup() 64 | t.goto(-170,20) 65 | t.pendown() 66 | t.left(90) 67 | curve() 68 | 69 | t.penup() 70 | t.goto(171.2,0) 71 | t.pendown() 72 | t.left(90) 73 | curve3() 74 | t.hideturtle() 75 | 76 | t.done() -------------------------------------------------------------------------------- /ironman.py: -------------------------------------------------------------------------------- 1 | import turtle as t 2 | 3 | a = [ 4 | [(-40, 120), (-70, 260), (-130, 230), (-170, 200), (-170, 100), (-160, 40), (-170, 10), (-150, -10), (-140, 10), 5 | (-40, -20), (0, -20)], 6 | [(0, -20), (40, -20), (140, 10), (150, -10), (170, 10), (160, 40), (170, 100), (170, 200), (130, 230), (70, 260), 7 | (40, 120), (0, 120)]] 8 | b = [ 9 | [(-40, -30), (-50, -40), (-100, -46), (-130, -40), (-176, 0), (-186, -30), (-186, -40), (-120, -170), (-110, -210), 10 | (-80, -230), (-64, -210), (0, -210)], 11 | [(0, -210), (64, -210), (80, -230), (110, -210), (120, -170), (186, -40), (186, -30), (176, 0), (130, -40), 12 | (100, -46), (50, -40), (40, -30), (0, -30)]] 13 | 14 | c = [ 15 | [(-60, -220), (-80, -240), (-110, -220), (-120, -250), (-90, -280), (-60, -260), (-30, -260), (-20, -250), 16 | (0, -250)], 17 | [(0, -250), (20, -250), (30, -260), (60, -260), (90, -280), (120, -250), (110, -220), (80, -240), (60, -220), 18 | (0, -220)]] 19 | t.hideturtle() 20 | t.bgcolor('#ba161e') 21 | t.setup(500, 600) 22 | t.title("ironman") 23 | piece1Goto = (0, 120) 24 | piece2Goto = (0, -30) 25 | piece3Goto = (0, -220) 26 | t.speed(2) 27 | 28 | 29 | def draw_piece(piece, pieceGoto): 30 | t.penup() 31 | t.goto(pieceGoto) 32 | t.pendown() 33 | t.color('#fab104') 34 | t.begin_fill() 35 | for i in range(len(piece[0])): 36 | x, y = piece[0][i] 37 | t.goto(x, y) 38 | 39 | for i in range(len(piece[1])): 40 | x, y = piece[1][i] 41 | t.goto(x, y) 42 | t.end_fill() 43 | 44 | 45 | draw_piece(a, piece1Goto) 46 | draw_piece(b, piece2Goto) 47 | draw_piece(c, piece3Goto) 48 | t.hideturtle() 49 | t.done() -------------------------------------------------------------------------------- /amongus.py: -------------------------------------------------------------------------------- 1 | import turtle as t 2 | 3 | char = 'red' 4 | char_glass = '#9acedc' 5 | t.pensize(20) 6 | t.penup() 7 | t.goto(0,-80) 8 | t.pendown() 9 | 10 | def body(): 11 | t.fillcolor(char) 12 | t.begin_fill() 13 | t.right(90) 14 | t.forward(50) 15 | t.right(180) 16 | t.circle(40, -180) 17 | t.right(180) 18 | t.forward(200) 19 | t.right(180) 20 | t.circle(100, -180) 21 | t.backward(20) 22 | t.left(15) 23 | t.circle(500, -20) 24 | t.backward(20) 25 | t.circle(40, -180) 26 | t.left(7) 27 | t.backward(50) 28 | t.up() 29 | t.left(90) 30 | t.forward(10) 31 | t.right(90) 32 | t.down() 33 | t.right(240) 34 | t.circle(50, -70) 35 | t.end_fill() 36 | 37 | 38 | def glass(): 39 | t.up() 40 | t.right(230) 41 | t.forward(100) 42 | t.left(90) 43 | t.forward(20) 44 | t.right(90) 45 | t.down() 46 | t.fillcolor(char_glass) 47 | t.begin_fill() 48 | t.right(150) 49 | t.circle(90, -55) 50 | t.right(180) 51 | t.forward(1) 52 | t.right(180) 53 | t.circle(10, -65) 54 | t.right(180) 55 | t.forward(110) 56 | t.right(180) 57 | t.circle(50, -190) 58 | t.right(170) 59 | t.forward(80) 60 | t.right(180) 61 | t.circle(45, -30) 62 | t.end_fill() 63 | 64 | 65 | def bag(): 66 | t.up() 67 | t.right(60) 68 | t.forward(100) 69 | t.right(90) 70 | t.forward(75) 71 | t.fillcolor(char) 72 | t.begin_fill() 73 | t.down() 74 | t.forward(30) 75 | t.right(255) 76 | t.circle(300, -30) 77 | t.right(260) 78 | t.forward(30) 79 | t.end_fill() 80 | 81 | 82 | body() 83 | glass() 84 | bag() 85 | t.hideturtle() 86 | t.done() -------------------------------------------------------------------------------- /githublogo.py: -------------------------------------------------------------------------------- 1 | import turtle as t 2 | 3 | t.begin_fill() 4 | t.fillcolor("black") 5 | 6 | t.penup() 7 | t.goto(-80,-200) 8 | t.pendown() 9 | t.left(90) 10 | 11 | for i in range(50): 12 | t.right(0.1) 13 | t.forward(1) 14 | 15 | t.left(90) 16 | 17 | for i in range(50): 18 | t.right(1) 19 | t.forward(1) 20 | 21 | for i in range(50): 22 | t.left(1) 23 | t.forward(1) 24 | 25 | for i in range(30): 26 | t.right(5) 27 | t.forward(1) 28 | 29 | for i in range(50): 30 | t.right(2) 31 | t.forward(1) 32 | 33 | for i in range(50): 34 | t.left(2) 35 | t.forward(1.2) 36 | 37 | t.left(50) 38 | 39 | for i in range(40): 40 | t.right(0.5) 41 | t.forward(1) 42 | 43 | t.left(90) 44 | 45 | for i in range(100): 46 | t.right(1) 47 | t.forward(2) 48 | 49 | t.left(90) 50 | 51 | for i in range(50): 52 | t.right(1) 53 | t.forward(1) 54 | 55 | t.right(90) 56 | 57 | for i in range(38): 58 | t.right(1) 59 | t.forward(2) 60 | 61 | t.left(90) 62 | 63 | for i in range(40): 64 | t.right(2) 65 | t.forward(3) 66 | 67 | t.left(80) 68 | 69 | for i in range(30): 70 | t.right(1) 71 | t.forward(2) 72 | 73 | t.right(90) 74 | 75 | for i in range(50): 76 | t.right(1) 77 | t.forward(1) 78 | 79 | t.left(90) 80 | 81 | for i in range(100): 82 | t.right(1) 83 | t.forward(2) 84 | 85 | t.left(50) 86 | 87 | for i in range(130): 88 | t.right(0.1) 89 | t.forward(1) 90 | 91 | t.left(130) 92 | 93 | for i in range(600): 94 | t.left(0.5) 95 | t.forward(2) 96 | 97 | t.left(130) 98 | 99 | for i in range(20): 100 | t.right(0.1) 101 | t.forward(1) 102 | 103 | t.end_fill() 104 | t.hideturtle() 105 | 106 | t.done() -------------------------------------------------------------------------------- /pythonlogo.py: -------------------------------------------------------------------------------- 1 | import turtle as t 2 | 3 | t.pensize(2) 4 | 5 | def curve(): 6 | for i in range(200): 7 | t.right(0.8) 8 | t.forward(1) 9 | 10 | def curve2(): 11 | for i in range(100): 12 | t.right(0.8) 13 | t.forward(1) 14 | 15 | def curve3(): 16 | for i in range(100): 17 | t.left(1) 18 | t.forward(1) 19 | 20 | t.penup() 21 | t.goto(0,50) 22 | t.pendown() 23 | t.begin_fill() 24 | t.fillcolor("#306998") 25 | t.backward(80) 26 | t.left(90) 27 | t.forward(35) 28 | curve() 29 | t.right(19.5) 30 | t.forward(80) 31 | curve2() 32 | t.right(10) 33 | t.forward(50) 34 | curve3() 35 | t.right(100) 36 | t.forward(50) 37 | curve() 38 | t.right(19.5) 39 | t.forward(181) 40 | t.left(90) 41 | t.forward(20) 42 | t.end_fill() 43 | t.penup() 44 | t.goto(-20,100) 45 | t.pendown() 46 | t.begin_fill() 47 | t.fillcolor("white") 48 | t.circle(19) 49 | t.end_fill() 50 | 51 | def curve4(): 52 | for i in range(200): 53 | t.right(0.8) 54 | t.backward(1) 55 | 56 | def curve5(): 57 | for i in range(100): 58 | t.right(0.8) 59 | t.backward(1) 60 | 61 | def curve6(): 62 | for i in range(100): 63 | t.left(1) 64 | t.backward(1) 65 | 66 | t.right(90) 67 | t.penup() 68 | t.goto(-25,-150) 69 | t.pendown() 70 | t.begin_fill() 71 | t.fillcolor("yellow") 72 | t.backward(-80) 73 | t.left(90) 74 | t.backward(35) 75 | curve4() 76 | t.right(19.5) 77 | t.backward(80) 78 | curve5() 79 | t.right(10) 80 | t.backward(50) 81 | curve6() 82 | t.right(100) 83 | t.backward(50) 84 | curve4() 85 | t.right(19.5) 86 | t.backward(181) 87 | t.left(90) 88 | t.backward(20) 89 | t.end_fill() 90 | t.penup() 91 | t.goto(38,-200) 92 | t.pendown() 93 | t.begin_fill() 94 | t.fillcolor("white") 95 | t.circle(19) 96 | t.end_fill() 97 | t.hideturtle() 98 | t.done() -------------------------------------------------------------------------------- /rockstargamelogo.py: -------------------------------------------------------------------------------- 1 | import turtle as t 2 | 3 | t.pensize(5) 4 | t.penup() 5 | t.goto(200,255) 6 | t.pendown() 7 | t.speed(0) 8 | 9 | t.begin_fill() 10 | t.fillcolor("#ffab00") 11 | for j in range(4): 12 | for i in range(45): 13 | t.right(2) 14 | t.forward(2) 15 | t.forward(400) 16 | t.end_fill() 17 | 18 | t.penup() 19 | t.goto(-100,-50) 20 | t.pendown() 21 | 22 | t.begin_fill() 23 | t.fillcolor("black") 24 | t.left(80) 25 | t.forward(200) 26 | t.right(80) 27 | t.forward(100) 28 | for i in range(180): 29 | t.right(1) 30 | t.forward(1) 31 | t.right(180) 32 | for i in range(40): 33 | t.right(2) 34 | t.forward(1) 35 | t.forward(80) 36 | t.right(100) 37 | t.forward(50) 38 | t.right(90) 39 | t.forward(50) 40 | for i in range(45): 41 | t.forward(1) 42 | t.left(2) 43 | t.forward(40) 44 | t.left(80) 45 | t.forward(70) 46 | t.right(80) 47 | t.forward(50) 48 | t.end_fill() 49 | 50 | 51 | t.penup() 52 | t.goto(-34,67) 53 | t.pendown() 54 | t.pencolor("#ffab00") 55 | 56 | 57 | t.begin_fill() 58 | t.fillcolor("#ffab00") 59 | t.right(100) 60 | t.forward(50) 61 | t.right(80) 62 | t.forward(50) 63 | for i in range(70): 64 | t.right(2) 65 | t.forward(1) 66 | t.end_fill() 67 | 68 | t.penup() 69 | t.goto(76,-74) 70 | t.pendown() 71 | t.pencolor("black") 72 | 73 | t.begin_fill() 74 | t.fillcolor("white") 75 | t.right(150) 76 | t.forward(80) 77 | t.right(150) 78 | t.forward(80) 79 | t.left(80) 80 | t.forward(74) 81 | t.right(150) 82 | t.forward(80) 83 | t.left(90) 84 | t.forward(80) 85 | t.right(150) 86 | t.forward(80) 87 | t.left(90) 88 | t.forward(80) 89 | t.right(154) 90 | t.forward(80) 91 | t.left(40) 92 | t.forward(80) 93 | t.end_fill() 94 | t.right(130) 95 | t.forward(64) 96 | t.hideturtle() 97 | 98 | t.done() -------------------------------------------------------------------------------- /roglogo.py: -------------------------------------------------------------------------------- 1 | import turtle as t 2 | 3 | t.speed(0) 4 | 5 | def curve1(): 6 | t.begin_fill() 7 | t.fillcolor("red") 8 | t.right(50) 9 | t.forward(100) 10 | t.right(150) 11 | for i in range(30): 12 | t.forward(2) 13 | t.right(1) 14 | t.end_fill() 15 | 16 | def curve2(): 17 | t.begin_fill() 18 | t.fillcolor("red") 19 | for i in range(20): 20 | t.right(1) 21 | t.forward(3) 22 | t.right(130) 23 | t.forward(50) 24 | t.left(80) 25 | for i in range(200): 26 | t.forward(1) 27 | t.right(0.1) 28 | t.right(20) 29 | for i in range(150): 30 | t.forward(1) 31 | t.right(0.1) 32 | t.right(164) 33 | for i in range(350): 34 | t.forward(1) 35 | t.left(0.1) 36 | t.left(80) 37 | t.forward(50) 38 | t.end_fill() 39 | 40 | def curve3(): 41 | t.begin_fill() 42 | t.fillcolor("red") 43 | t.left(80) 44 | t.forward(230) 45 | t.right(150) 46 | for i in range(200): 47 | t.forward(1) 48 | t.right(0.1) 49 | t.right(30) 50 | for i in range(170): 51 | t.forward(1) 52 | t.right(0.2) 53 | t.right(120) 54 | for i in range(164): 55 | t.forward(2) 56 | t.right(0.1) 57 | t.right(90) 58 | t.forward(14) 59 | t.right(90) 60 | for i in range(150): 61 | t.forward(2) 62 | t.left(0.1) 63 | t.left(134) 64 | for i in range(130): 65 | t.forward(1) 66 | t.left(0.1) 67 | t.left(50) 68 | for i in range(90): 69 | t.forward(1) 70 | t.left(0.1) 71 | t.left(140) 72 | t.forward(50) 73 | t.end_fill() 74 | t.hideturtle() 75 | 76 | t.penup() 77 | t.goto(-200,0) 78 | t.pendown() 79 | curve1() 80 | 81 | t.penup() 82 | t.goto(-140,-55) 83 | t.pendown() 84 | t.right(5) 85 | curve2() 86 | 87 | t.penup() 88 | t.goto(0,-20) 89 | t.pendown() 90 | curve3() 91 | 92 | 93 | t.done() -------------------------------------------------------------------------------- /amazingspiral.py: -------------------------------------------------------------------------------- 1 | import turtle as t 2 | 3 | t.reset() 4 | t.hideturtle() 5 | t.speed(0) 6 | 7 | t.bgcolor('black') 8 | 9 | c = 0 10 | x = 0 11 | 12 | colors = [ 13 | #red 14 | (1.00, 0.00, 0.00),(1.00, 0.03, 0.00),(1.00, 0.05, 0.00),(1.00, 0.07, 0.00),(1.00, 0.10, 0.00),(1.00, 0.12, 0.00),(1.00, 0.15, 0.00),(1.00, 0.17, 0.00),(1.00, 0.20, 0.00),(1.00, 0.23, 0.00),(1.00, 0.25, 0.00),(1.00, 0.28, 0.00),(1.00, 0.30, 0.00),(1.00, 0.33, 0.00),(1.00, 0.35, 0.00),(1.00, 0.38, 0.00),(1.00, 0.40, 0.00),(1.00, 0.42, 0.00),(1.00, 0.45, 0.00),(1.00, 0.47, 0.00), 15 | #orange 16 | (1.00, 0.50, 0.00),(1.00, 0.53, 0.00),(1.00, 0.55, 0.00),(1.00, 0.57, 0.00),(1.00, 0.60, 0.00),(1.00, 0.62, 0.00),(1.00, 0.65, 0.00),(1.00, 0.68, 0.00),(1.00, 0.70, 0.00),(1.00, 0.72, 0.00),(1.00, 0.75, 0.00),(1.00, 0.78, 0.00),(1.00, 0.80, 0.00),(1.00, 0.82, 0.00),(1.00, 0.85, 0.00),(1.00, 0.88, 0.00),(1.00, 0.90, 0.00),(1.00, 0.93, 0.00),(1.00, 0.95, 0.00),(1.00, 0.97, 0.00), 17 | #yellow 18 | (1.00, 1.00, 0.00),(0.95, 1.00, 0.00),(0.90, 1.00, 0.00),(0.85, 1.00, 0.00),(0.80, 1.00, 0.00),(0.75, 1.00, 0.00),(0.70, 1.00, 0.00),(0.65, 1.00, 0.00),(0.60, 1.00, 0.00),(0.55, 1.00, 0.00),(0.50, 1.00, 0.00),(0.45, 1.00, 0.00),(0.40, 1.00, 0.00),(0.35, 1.00, 0.00),(0.30, 1.00, 0.00),(0.25, 1.00, 0.00),(0.20, 1.00, 0.00),(0.15, 1.00, 0.00),(0.10, 1.00, 0.00),(0.05, 1.00, 0.00), 19 | #green 20 | (0.00, 1.00, 0.00),(0.00, 0.95, 0.05),(0.00, 0.90, 0.10),(0.00, 0.85, 0.15),(0.00, 0.80, 0.20),(0.00, 0.75, 0.25),(0.00, 0.70, 0.30),(0.00, 0.65, 0.35),(0.00, 0.60, 0.40),(0.00, 0.55, 0.45),(0.00, 0.50, 0.50),(0.00, 0.45, 0.55),(0.00, 0.40, 0.60),(0.00, 0.35, 0.65),(0.00, 0.30, 0.70),(0.00, 0.25, 0.75),(0.00, 0.20, 0.80),(0.00, 0.15, 0.85),(0.00, 0.10, 0.90),(0.00, 0.05, 0.95), 21 | #blue 22 | (0.00, 0.00, 1.00),(0.05, 0.00, 1.00),(0.10, 0.00, 1.00),(0.15, 0.00, 1.00),(0.20, 0.00, 1.00),(0.25, 0.00, 1.00),(0.30, 0.00, 1.00),(0.35, 0.00, 1.00),(0.40, 0.00, 1.00),(0.45, 0.00, 1.00),(0.50, 0.00, 1.00),(0.55, 0.00, 1.00),(0.60, 0.00, 1.00),(0.65, 0.00, 1.00),(0.70, 0.00, 1.00),(0.75, 0.00, 1.00),(0.80, 0.00, 1.00),(0.85, 0.00, 1.00),(0.90, 0.00, 1.00),(0.95, 0.00, 1.00) 23 | ] 24 | 25 | while x < 1000: 26 | idx = int(c) 27 | color = colors[idx] 28 | t.color(color) 29 | t.forward(x) 30 | t.right(98) 31 | x = x + 1 32 | c = c + 0.1 33 | 34 | t.exitonclick() -------------------------------------------------------------------------------- /android logo.py: -------------------------------------------------------------------------------- 1 | import turtle as t 2 | 3 | t.penup() 4 | t.goto(-80,80) 5 | t.pendown() 6 | 7 | t.speed(0) 8 | t.pencolor("#3DDC84") 9 | 10 | def circle(): 11 | t.begin_fill() 12 | t.fillcolor("white") 13 | t.circle(7) 14 | t.end_fill() 15 | 16 | def android1(): 17 | t.begin_fill() 18 | t.fillcolor("#3DDC84") 19 | t.forward(150) 20 | t.left(90) 21 | for i in range(238): 22 | t.left(0.76) 23 | t.forward(1) 24 | t.end_fill() 25 | 26 | t.penup() 27 | t.goto(-40, 120) 28 | t.pendown() 29 | circle() 30 | 31 | t.penup() 32 | t.goto(24, 120) 33 | t.pendown() 34 | circle() 35 | 36 | t.penup() 37 | t.goto(-34, 150) 38 | t.pendown() 39 | 40 | t.pensize(4) 41 | t.right(140) 42 | t.forward(40) 43 | 44 | t.penup() 45 | t.goto(34, 144) 46 | t.pendown() 47 | 48 | t.pensize(4) 49 | t.right(80) 50 | t.forward(46) 51 | 52 | def android2(): 53 | t.begin_fill() 54 | t.fillcolor("#3DDC84") 55 | t.pensize(1) 56 | t.right(141) 57 | t.forward(100) 58 | for i in range(20): 59 | t.forward(1) 60 | t.left(5) 61 | t.right(9.5) 62 | t.forward(127) 63 | for i in range(20): 64 | t.forward(1) 65 | t.left(5) 66 | t.right(9.5) 67 | t.forward(100) 68 | t.end_fill() 69 | 70 | def android3(): 71 | t.begin_fill() 72 | t.fillcolor("#3DDC84") 73 | for i in range(45): 74 | t.right(4) 75 | t.forward(1) 76 | t.forward(70) 77 | for i in range(45): 78 | t.right(4) 79 | t.forward(1) 80 | t.forward(70) 81 | t.end_fill() 82 | 83 | def android4(): 84 | t.begin_fill() 85 | t.fillcolor("#3DDC84") 86 | t.right(91) 87 | t.forward(30) 88 | t.right(90) 89 | t.forward(50) 90 | for i in range(45): 91 | t.right(4) 92 | t.forward(1) 93 | t.end_fill() 94 | 95 | 96 | android1() 97 | 98 | t.penup() 99 | t.goto(-80,68) 100 | t.pendown() 101 | 102 | android2() 103 | 104 | t.penup() 105 | t.goto(80,68) 106 | t.pendown() 107 | 108 | android3() 109 | 110 | t.penup() 111 | t.goto(-124,70) 112 | t.pendown() 113 | 114 | android3() 115 | 116 | t.penup() 117 | t.goto(-50,-50) 118 | t.pendown() 119 | android4() 120 | 121 | t.penup() 122 | t.goto(14,-50) 123 | t.pendown() 124 | t.left(1.7) 125 | android4() 126 | 127 | t.hideturtle() 128 | 129 | t.done() 130 | -------------------------------------------------------------------------------- /Captain America's Shield.py: -------------------------------------------------------------------------------- 1 | import turtle as t 2 | 3 | l = 200 4 | 5 | def triangle(): 6 | for i in range(3): 7 | t.forward(l) 8 | t.right(120) 9 | 10 | def triangle2(l): 11 | for i in range(3): 12 | t.forward(l) 13 | t.right(120) 14 | 15 | def polygon(l, n): 16 | angle = 360 / n 17 | for i in range(n): 18 | t.forward(l) 19 | t.right(angle) 20 | 21 | def five_star(l): 22 | for i in range(5): 23 | t.forward(l) 24 | t.right(144) 25 | def circle(): 26 | for i in range(36): 27 | t.forward(10) 28 | t.right(15) 29 | 30 | def square(x, y, l): 31 | t.penup() 32 | t.goto(x, y) 33 | t.pendown() 34 | for i in range(4): 35 | t.forward(l) 36 | t.right(90) 37 | def setpen(x, y): 38 | t.penup() 39 | t.goto(x, y) 40 | t.pendown() 41 | t.setheading(0) 42 | 43 | def square(x, y, l): 44 | setpen(x, y) 45 | for i in range(4): 46 | t.forward(l) 47 | t.right(90) 48 | 49 | def square_line(x, y, l, n, dis): 50 | for i in range(n): 51 | inner_x = x + (l + dis) * i 52 | square(inner_x, y, l) 53 | 54 | def square_matrix(x, y, l, n, dis, m): 55 | for i in range(m): 56 | inner_y = y - (l + dis) * i 57 | square_line(x, inner_y, l, n, dis) 58 | 59 | def five_star(l): 60 | t.fillcolor('yellow') 61 | t.begin_fill() 62 | for i in range(5): 63 | t.forward(l) 64 | t.right(144) 65 | t.end_fill() 66 | colors = ['red', 'yellow', 'darkblue', 'green'] 67 | 68 | def circle(x, y, r, color): 69 | n = 36 70 | angle = 360 / n 71 | pi = 3.1415926 72 | c = 2 * pi * r 73 | l = c / n 74 | start_x = x - l / 2 75 | start_y = y + r 76 | setpen(start_x, start_y) 77 | t.pencolor(color) 78 | t.fillcolor(color) 79 | t.begin_fill() 80 | 81 | for i in range(n): 82 | t.forward(l) 83 | t.right(angle) 84 | t.end_fill() 85 | 86 | def five_star(l): 87 | setpen(0, 0) 88 | t.setheading(162) 89 | t.forward(150) 90 | t.setheading(0) 91 | t.fillcolor('WhiteSmoke') 92 | t.begin_fill() 93 | t.hideturtle() 94 | t.penup() 95 | 96 | for i in range(5): 97 | t.forward(l) 98 | t.right(144) 99 | t.end_fill() 100 | 101 | def sheild(): 102 | circle(0, 0, 300, 'red') 103 | circle(0, 0, 250, 'white') 104 | circle(0, 0, 200, 'red') 105 | circle(0, 0, 150, 'darkblue') 106 | five_star(284) 107 | 108 | sheild() 109 | t.done() -------------------------------------------------------------------------------- /neural network design.py: -------------------------------------------------------------------------------- 1 | import turtle 2 | import random 3 | 4 | # Set up the screen 5 | screen = turtle.Screen() 6 | screen.bgcolor("white") 7 | 8 | pen = turtle.Turtle() 9 | pen.speed(0) 10 | pen.width(2) 11 | 12 | input_color = "#0000FF" # Blue 13 | hidden_color = "#808080" # Grey 14 | output_color = "#000000" # Black 15 | connection_colors = ["#FF5733", "#33FF57", "#3357FF", 16 | "#F333FF", "#FFD633", "#33FFF5", "#FF33C4"] 17 | 18 | def draw_neuron(x, y, color, radius=20): 19 | pen.penup() 20 | pen.goto(x, y - radius) 21 | pen.pendown() 22 | pen.color(color) 23 | pen.begin_fill() 24 | pen.circle(radius) 25 | pen.end_fill() 26 | 27 | def draw_connection(x1, y1, x2, y2): 28 | pen.penup() 29 | pen.goto(x1, y1) 30 | pen.pendown() 31 | pen.color(random.choice(connection_colors)) 32 | pen.goto(x2, y2) 33 | 34 | def calculate_layer_positions(neurons, center_y, y_gap): 35 | return [center_y - (neurons - 1) * y_gap / 36 | 2 + i * y_gap for i in range(neurons)] 37 | 38 | def draw_layer(x, y_positions, color): 39 | positions = [] 40 | for y in y_positions: 41 | draw_neuron(x, y, color) 42 | positions.append((x, y)) 43 | return positions 44 | 45 | def connect_layers(layer1, layer2): 46 | for x1, y1 in layer1: 47 | for x2, y2 in layer2: 48 | draw_connection(x1 + 20, y1, x2 - 20, y2) 49 | 50 | input_neurons = 3 51 | hidden_neurons_1 = 5 52 | hidden_neurons_2 = 5 53 | output_neurons = 2 54 | 55 | x_positions = { 56 | 'input': -300, 57 | 'hidden_1': -100, 58 | 'hidden_2': 100, 59 | 'output': 300 60 | } 61 | 62 | center_y_hidden = 100 63 | y_gap_hidden = 75 64 | 65 | y_hidden_1 = calculate_layer_positions(hidden_neurons_1, 66 | center_y_hidden, y_gap_hidden) 67 | y_hidden_2 = calculate_layer_positions(hidden_neurons_2, 68 | center_y_hidden, y_gap_hidden) 69 | 70 | 71 | y_input = calculate_layer_positions(input_neurons, 72 | center_y_hidden, 100) 73 | y_output = calculate_layer_positions(output_neurons, 74 | center_y_hidden, 100) 75 | 76 | 77 | input_positions = draw_layer(x_positions['input'], y_input, input_color) 78 | hidden_1_positions = draw_layer(x_positions['hidden_1'], y_hidden_1, hidden_color) 79 | hidden_2_positions = draw_layer(x_positions['hidden_2'], y_hidden_2, hidden_color) 80 | output_positions = draw_layer(x_positions['output'], y_output, output_color) 81 | 82 | 83 | connect_layers(input_positions, hidden_1_positions) 84 | connect_layers(hidden_1_positions, hidden_2_positions) 85 | connect_layers(hidden_2_positions, output_positions) 86 | 87 | 88 | pen.penup() 89 | pen.goto(0, -250) 90 | pen.pendown() 91 | pen.color("black") 92 | pen.write("@coding_nitul", align="center", font=("Arial", 16, "normal")) 93 | 94 | 95 | pen.hideturtle() 96 | turtle.done() 97 | -------------------------------------------------------------------------------- /earth.py: -------------------------------------------------------------------------------- 1 | import turtle as t 2 | 3 | t.pensize(2) 4 | t.penup() 5 | t.goto(0,-180) 6 | t.pendown() 7 | 8 | t.begin_fill() 9 | t.fillcolor("#2384eb") 10 | t.circle(200) 11 | t.end_fill() 12 | t.right(90) 13 | t.begin_fill() 14 | t.fillcolor("green") 15 | t.penup() 16 | t.goto(100,195) 17 | t.pendown() 18 | t.forward(20) 19 | t.left(90) 20 | t.forward(20) 21 | t.right(90) 22 | t.forward(20) 23 | t.right(20) 24 | t.forward(20) 25 | t.right(20) 26 | t.forward(20) 27 | t.left(90) 28 | t.forward(20) 29 | t.left(90) 30 | t.forward(20) 31 | t.right(50) 32 | t.forward(30) 33 | t.right(90) 34 | t.forward(20) 35 | t.right(90) 36 | t.forward(20) 37 | t.right(5) 38 | t.forward(20) 39 | t.left(20) 40 | t.forward(20) 41 | t.left(20) 42 | t.forward(20) 43 | t.left(20) 44 | t.forward(20) 45 | t.left(20) 46 | t.forward(20) 47 | t.left(20) 48 | t.forward(50) 49 | t.left(50) 50 | t.forward(20) 51 | t.left(50) 52 | t.forward(50) 53 | t.right(90) 54 | t.forward(20) 55 | t.right(20) 56 | t.forward(20) 57 | t.right(20) 58 | t.forward(50) 59 | t.left(90) 60 | t.forward(20) 61 | t.left(20) 62 | t.forward(20) 63 | t.left(90) 64 | t.forward(50) 65 | t.right(90) 66 | t.forward(20) 67 | t.left(95) 68 | t.forward(145) 69 | t.left(20) 70 | t.forward(20) 71 | t.left(20) 72 | t.forward(50) 73 | t.left(20) 74 | t.forward(20) 75 | t.right(20) 76 | t.forward(37) 77 | t.left(90) 78 | t.end_fill() 79 | t.begin_fill() 80 | t.fillcolor("green") 81 | t.penup() 82 | t.goto(80,180) 83 | t.pendown() 84 | t.left(90) 85 | t.forward(20) 86 | t.right(90) 87 | t.forward(20) 88 | t.right(90) 89 | t.forward(20) 90 | t.right(90) 91 | t.forward(20) 92 | t.end_fill() 93 | t.penup() 94 | t.goto(-50,-174) 95 | t.pendown() 96 | t.begin_fill() 97 | t.fillcolor("green") 98 | t.forward(20) 99 | t.right(90) 100 | t.forward(20) 101 | t.left(80) 102 | t.forward(20) 103 | t.right(20) 104 | t.forward(100) 105 | t.right(90) 106 | t.forward(5) 107 | t.right(78) 108 | t.forward(68) 109 | t.end_fill() 110 | t.penup() 111 | t.goto(-20,219) 112 | t.pendown() 113 | t.begin_fill() 114 | t.fillcolor("green") 115 | t.left(90) 116 | t.forward(20) 117 | t.right(20) 118 | t.forward(20) 119 | t.left(90) 120 | t.forward(20) 121 | t.left(20) 122 | t.forward(20) 123 | t.left(90) 124 | t.forward(20) 125 | t.left(20) 126 | t.forward(20) 127 | t.end_fill() 128 | t.penup() 129 | t.goto(-40,219) 130 | t.right(200) 131 | t.pendown() 132 | t.begin_fill() 133 | t.fillcolor("green") 134 | t.forward(20) 135 | t.right(90) 136 | t.forward(50) 137 | t.right(90) 138 | t.left(90) 139 | t.left(90) 140 | t.forward(20) 141 | t.left(100) 142 | t.forward(50) 143 | t.right(90) 144 | t.forward(20) 145 | t.right(90) 146 | t.forward(100) 147 | t.left(20) 148 | t.forward(50) 149 | t.left(20) 150 | t.forward(20) 151 | t.right(20) 152 | t.forward(20) 153 | t.right(90) 154 | t.forward(20) 155 | t.left(90) 156 | t.forward(20) 157 | t.left(50) 158 | t.forward(20) 159 | t.left(90) 160 | t.forward(20) 161 | t.right(90) 162 | t.forward(50) 163 | t.left(100) 164 | t.forward(20) 165 | t.left(20) 166 | t.forward(20) 167 | t.right(90) 168 | t.forward(20) 169 | t.left(20) 170 | t.forward(50) 171 | t.right(20) 172 | t.forward(20) 173 | t.left(20) 174 | t.forward(20) 175 | t.left(90) 176 | t.forward(20) 177 | t.right(90) 178 | t.forward(20) 179 | t.right(90) 180 | t.forward(50) 181 | t.right(20) 182 | t.forward(20) 183 | t.left(20) 184 | t.forward(20) 185 | t.right(100) 186 | t.forward(100) 187 | t.left(20) 188 | t.forward(50) 189 | t.right(90) 190 | t.forward(30) 191 | t.left(20) 192 | t.forward(40) 193 | t.left(90) 194 | t.forward(20) 195 | t.right(90) 196 | t.forward(50) 197 | t.right(20) 198 | t.forward(80) 199 | t.right(30) 200 | t.forward(80) 201 | t.right(20) 202 | t.forward(70) 203 | t.right(100) 204 | t.end_fill() 205 | t.hideturtle() 206 | t.done() -------------------------------------------------------------------------------- /transformer.py: -------------------------------------------------------------------------------- 1 | import turtle as t 2 | 3 | t.penup() 4 | t.pensize(2) 5 | 6 | t.begin_fill() 7 | t.fillcolor("red") 8 | t.setposition(25,-89) 9 | t.pendown() 10 | t.setposition(45,-103) 11 | t.setposition(45,-111) 12 | t.setposition(57,-120) 13 | t.setposition(57,-174) 14 | t.setposition(32,-151) 15 | t.setposition(25,-89) 16 | t.end_fill() 17 | t.penup() 18 | 19 | t.begin_fill() 20 | t.setposition(175,-89) 21 | t.pendown() 22 | t.setposition(156,-103) 23 | t.setposition(156,-111) 24 | t.setposition(143,-120) 25 | t.setposition(143,-174) 26 | t.setposition(168,-151) 27 | t.setposition(175,-89) 28 | t.end_fill() 29 | t.penup() 30 | 31 | t.begin_fill() 32 | t.setposition(80,-193) 33 | t.pendown() 34 | t.setposition(120,-193) 35 | t.setposition(114,-174) 36 | t.setposition(86,-174) 37 | t.setposition(80,-193) 38 | t.end_fill() 39 | t.penup() 40 | 41 | t.begin_fill() 42 | t.setposition(71,-189) 43 | t.pendown() 44 | t.setposition(66,-184) 45 | t.setposition(66,-120) 46 | t.setposition(82,-111) 47 | t.setposition(82,-155) 48 | t.setposition(118,-155) 49 | t.setposition(118,-111) 50 | t.setposition(134,-120) 51 | t.setposition(134,-184) 52 | t.setposition(129,-189) 53 | t.setposition(120,-165) 54 | t.setposition(81,-165) 55 | t.setposition(71,-189) 56 | t.end_fill() 57 | t.penup() 58 | 59 | t.begin_fill() 60 | t.setposition(92,-147) 61 | t.pendown() 62 | t.setposition(108,-147) 63 | t.setposition(108,-102) 64 | t.setposition(115,-68) 65 | t.setposition(100,-78) 66 | t.setposition(85,-68) 67 | t.setposition(92,-102) 68 | t.setposition(92,-147) 69 | t.end_fill() 70 | t.penup() 71 | 72 | t.begin_fill() 73 | t.fillcolor("blue") 74 | t.setposition(100,-68) 75 | t.pendown() 76 | t.setposition(44,-30) 77 | t.setposition(42,-18) 78 | t.setposition(46,-16) 79 | t.setposition(49,-15) 80 | t.setposition(52,-14) 81 | t.setposition(58,-12) 82 | t.setposition(62,-11) 83 | t.setposition(66,-10) 84 | t.setposition(71,-9) 85 | t.setposition(76,-8) 86 | t.setposition(85,-7) 87 | t.setposition(116,-7) 88 | t.setposition(123,-8) 89 | t.setposition(128,-9) 90 | t.setposition(133,-10) 91 | t.setposition(137,-11) 92 | t.setposition(141,-12) 93 | t.setposition(147,-14) 94 | t.setposition(150,-15) 95 | t.setposition(153,-16) 96 | t.setposition(157,-18) 97 | t.setposition(155,-30) 98 | t.setposition(100,-68) 99 | t.end_fill() 100 | t.penup() 101 | 102 | t.begin_fill() 103 | t.setposition(118,-95) 104 | t.pendown() 105 | t.setposition(153,-95) 106 | t.setposition(179,-76) 107 | t.setposition(191,-18) 108 | t.setposition(167,-18) 109 | t.setposition(163,-34) 110 | t.setposition(125,-60) 111 | t.setposition(118,-95) 112 | t.end_fill() 113 | t.penup() 114 | 115 | t.begin_fill() 116 | t.setposition(82,-95) 117 | t.pendown() 118 | t.setposition(47,-95) 119 | t.setposition(21,-76) 120 | t.setposition(10,-18) 121 | t.setposition(34,-18) 122 | t.setposition(37,-34) 123 | t.setposition(75,-60) 124 | t.setposition(82,-95) 125 | t.end_fill() 126 | t.penup() 127 | 128 | t.color('white') 129 | t.begin_fill() 130 | t.setposition(100,-46) 131 | t.pendown() 132 | t.setposition(72,-27) 133 | t.setposition(77,-25) 134 | t.setposition(81,-24) 135 | t.setposition(86,-23) 136 | t.setposition(95,-22) 137 | t.setposition(105,-22) 138 | t.setposition(114,-23) 139 | t.setposition(119,-24) 140 | t.setposition(123,-25) 141 | t.setposition(128,-27) 142 | t.setposition(100,-46) 143 | t.end_fill() 144 | t.penup() 145 | 146 | t.begin_fill() 147 | t.setposition(72,-88) 148 | t.pendown() 149 | t.setposition(34,-64) 150 | t.setposition(33,-56) 151 | t.setposition(71,-81) 152 | t.setposition(72,-88) 153 | t.end_fill() 154 | t.penup() 155 | 156 | t.begin_fill() 157 | t.setposition(70,-71) 158 | t.pendown() 159 | t.setposition(33,-47) 160 | t.setposition(31,-39) 161 | t.setposition(70,-64) 162 | t.setposition(70,-71) 163 | t.end_fill() 164 | t.penup() 165 | 166 | t.begin_fill() 167 | t.setposition(128,-88) 168 | t.pendown() 169 | t.setposition(166,-64) 170 | t.setposition(167,-56) 171 | t.setposition(129,-81) 172 | t.setposition(128,-88) 173 | t.end_fill() 174 | t.penup() 175 | 176 | t.begin_fill() 177 | t.setposition(130,-71) 178 | t.pendown() 179 | t.setposition(167,-47) 180 | t.setposition(169,-39) 181 | t.setposition(130,-64) 182 | t.setposition(130,-71) 183 | t.end_fill() 184 | t.penup() 185 | 186 | t.ht() 187 | t.exitonclick() -------------------------------------------------------------------------------- /pikachu.py: -------------------------------------------------------------------------------- 1 | from turtle import * 2 | 3 | screensize(800, 600, "#fed926") 4 | setup(width=1000, height=1000, startx=50, starty=50) 5 | pensize(5) 6 | pencolor("black") 7 | speed(11) 8 | 9 | 10 | def leftEar(): 11 | setheading(30) 12 | penup() 13 | fillcolor("#1f1515") 14 | goto(110, 150) 15 | pendown() 16 | setheading(30) 17 | left(5) 18 | circle(-410, 55) 19 | penup() 20 | goto(170, 100) 21 | setheading(0) 22 | pendown() 23 | right(2) 24 | circle(500, 39) 25 | begin_fill() 26 | left(124) 27 | circle(400, 15) 28 | left(-90) 29 | circle(200, -27) 30 | right(42) 31 | circle(400, 20) 32 | end_fill() 33 | penup() 34 | 35 | 36 | def rightEar(): 37 | goto(-120, 180) 38 | left(10) 39 | pendown() 40 | circle(400, 50) 41 | left(118) 42 | circle(400, 60) 43 | penup() 44 | goto(-75, 450) 45 | left(-140) 46 | pendown() 47 | begin_fill() 48 | circle(400, -13) 49 | right(41) 50 | circle(405, 17) 51 | left(120) 52 | circle(400, 10) 53 | end_fill() 54 | penup() 55 | 56 | 57 | def head(): 58 | goto(-130, 175) 59 | right(32) 60 | pendown() 61 | circle(400, -37) 62 | penup() 63 | goto(181, 99) 64 | left(125) 65 | pendown() 66 | right(180) 67 | circle(400, -20) 68 | left(165) 69 | circle(200, 40) 70 | left(190) 71 | circle(400, -40) 72 | circle(200, -40) 73 | penup() 74 | goto(-170, 160) 75 | left(190) 76 | pendown() 77 | circle(150, 40) 78 | right(180) 79 | circle(180, -30) 80 | left(170) 81 | circle(50, 80) 82 | circle(400, 20) 83 | penup() 84 | def rightHand(): 85 | goto(-200, -130) 86 | right(120) 87 | pendown() 88 | circle(200, 20) 89 | circle(60, 120) 90 | circle(400, 14) 91 | penup() 92 | goto(-170, -190) 93 | pendown() 94 | left(175) 95 | circle(200, -30) 96 | penup() 97 | 98 | 99 | def leftHand(): 100 | goto(130, -175) 101 | pendown() 102 | left(20) 103 | circle(250, 64) 104 | circle(10, 110) 105 | circle(300, 40) 106 | penup() 107 | 108 | 109 | def tummy(): 110 | goto(-210, -278) 111 | left(80) 112 | pendown() 113 | circle(50, -10) 114 | right(210) 115 | circle(400, 20) 116 | circle(50, 50) 117 | circle(400, 5) 118 | penup() 119 | fillcolor("#ce7f38") 120 | goto(206, -220) 121 | right(120) 122 | begin_fill() 123 | circle(40, 40) 124 | circle(5, 120) 125 | right(20) 126 | circle(40, 41) 127 | end_fill() 128 | goto(235, -350) 129 | left(160) 130 | begin_fill() 131 | circle(50, 50) 132 | circle(5, 120) 133 | right(15) 134 | circle(50, 45) 135 | end_fill() 136 | 137 | 138 | def leftEye(): 139 | penup() 140 | goto(80, 90) 141 | left(180) 142 | pendown() 143 | goto(30, 60) 144 | penup() 145 | left(45) 146 | fillcolor("#1c1c1b") 147 | begin_fill() 148 | circle(44, 295) 149 | end_fill() 150 | fillcolor("#f7ebfc") 151 | goto(60, 65) 152 | begin_fill() 153 | circle(12, 360) 154 | end_fill() 155 | 156 | 157 | def rightEye(): 158 | goto(-160, 100) 159 | pendown() 160 | goto(-105, 70) 161 | penup() 162 | goto(-107, 72) 163 | fillcolor("#1c1c1b") 164 | begin_fill() 165 | right(110) 166 | circle(100, -45) 167 | circle(20, -95) 168 | right(25) 169 | circle(100, -43) 170 | end_fill() 171 | fillcolor("#f7ebfc") 172 | goto(-150, 75) 173 | begin_fill() 174 | circle(12, 360) 175 | end_fill() 176 | 177 | 178 | def leftBlush(): 179 | goto(75, -5) 180 | pendown() 181 | fillcolor("#f24a23") 182 | begin_fill() 183 | right(40) 184 | circle(50, 360) 185 | end_fill() 186 | penup() 187 | 188 | 189 | def rightBlush(): 190 | goto(-215, 10) 191 | right(35) 192 | pendown() 193 | begin_fill() 194 | circle(50, -135) 195 | right(62) 196 | circle(50, -75) 197 | goto(-217, 10) 198 | end_fill() 199 | penup() 200 | 201 | 202 | def nose(): 203 | goto(-90, 20) 204 | pendown() 205 | fillcolor("#2a0f00") 206 | begin_fill() 207 | right(48) 208 | circle(30, -30) 209 | right(90) 210 | circle(30, -30) 211 | right(80) 212 | circle(30, -30) 213 | end_fill() 214 | penup() 215 | 216 | 217 | def mouth(): 218 | goto(-90, -30) 219 | left(150) 220 | pendown() 221 | circle(30, -130) 222 | penup() 223 | goto(-90, -30) 224 | pendown() 225 | circle(100, 40) 226 | circle(30, 110) 227 | 228 | 229 | if __name__ == '__main__': 230 | leftEar() 231 | rightEar() 232 | head() 233 | rightHand() 234 | leftHand() 235 | tummy() 236 | leftEye() 237 | rightEye() 238 | leftBlush() 239 | rightBlush() 240 | nose() 241 | mouth() 242 | done() -------------------------------------------------------------------------------- /spongebob.py: -------------------------------------------------------------------------------- 1 | import turtle 2 | from turtle import * 3 | turtle.speed(0) 4 | def go_to(x, y): 5 | penup() 6 | goto(x, y) 7 | pendown() 8 | 9 | def help_do(): 10 | goto(-400, 0) 11 | forward(800) 12 | go_to(-400, 100) 13 | forward(800) 14 | go_to(-400,200) 15 | forward(800) 16 | go_to(-400, -100) 17 | forward(800) 18 | go_to(-400, -200) 19 | forward(800) 20 | left(90) 21 | go_to(0,-300) 22 | forward(600) 23 | go_to(100, -300) 24 | forward(600) 25 | go_to(-100, -300) 26 | forward(600) 27 | go_to(-200, -300) 28 | forward(600) 29 | go_to(200, -300) 30 | forward(600) 31 | 32 | def head(): 33 | go_to(-200, 180) 34 | fillcolor('yellow') 35 | begin_fill() 36 | seth(-30) 37 | for _ in range(6): 38 | circle(36, 60) 39 | circle(-36, 60) 40 | seth(-125) 41 | for _ in range(5): 42 | circle(40,60) 43 | circle(-40,60) 44 | seth(-210) 45 | for _ in range(4): 46 | circle(45,60) 47 | circle(-45,60) 48 | seth(65) 49 | for _ in range(5): 50 | circle(40,60) 51 | circle(-40,60) 52 | end_fill() 53 | 54 | def eye(): 55 | go_to(14, -5) 56 | fillcolor('#f0f0f0') 57 | begin_fill() 58 | circle(65, 360) 59 | end_fill() 60 | begin_fill() 61 | go_to(13,12) 62 | seth(98) 63 | circle(-65,360) 64 | end_fill() 65 | 66 | go_to(-10,20) 67 | fillcolor('blue') 68 | begin_fill() 69 | circle(20,360) 70 | end_fill() 71 | go_to(-22,20) 72 | fillcolor('black') 73 | begin_fill() 74 | circle(7,360) 75 | end_fill() 76 | go_to(40,15) 77 | fillcolor('blue') 78 | begin_fill() 79 | circle(-20, 360) 80 | end_fill() 81 | go_to(53,15) 82 | fillcolor('black') 83 | begin_fill() 84 | circle(-7,360) 85 | end_fill() 86 | 87 | go_to(-95,65) 88 | left(20) 89 | forward(40) 90 | go_to(-50,87) 91 | right(25) 92 | forward(32) 93 | go_to(0,70) 94 | right(25) 95 | forward(40) 96 | 97 | go_to(40, 75) 98 | left(35) 99 | forward(40) 100 | go_to(90, 87) 101 | right(18) 102 | forward(30) 103 | go_to(120, 70) 104 | right(25) 105 | forward(40) 106 | 107 | def nose(): 108 | fillcolor('yellow') 109 | go_to(0, -7) 110 | begin_fill() 111 | right(50) 112 | circle(-60, 30) 113 | color('yellow') 114 | goto(15,-40) 115 | end_fill() 116 | color('black') 117 | go_to(0, -7) 118 | seth(-75) 119 | forward(30) 120 | go_to(30,-7) 121 | seth(-105) 122 | forward(30) 123 | 124 | def mouth(): 125 | go_to(-120, - 60) 126 | seth(-45) 127 | circle(200, 30) 128 | seth(0) 129 | forward(100) 130 | seth(15) 131 | circle(200, 30) 132 | 133 | def tooth(): 134 | go_to(-30,-114) 135 | seth(-95) 136 | fillcolor('white') 137 | begin_fill() 138 | forward(30) 139 | seth(0) 140 | forward(40) 141 | seth(95) 142 | forward(30) 143 | go_to(-30,-114) 144 | end_fill() 145 | 146 | go_to(30, -114) 147 | seth(-95) 148 | fillcolor('white') 149 | begin_fill() 150 | forward(30) 151 | seth(0) 152 | forward(40) 153 | seth(95) 154 | forward(30) 155 | go_to(60, -114) 156 | end_fill() 157 | 158 | def hole(): 159 | go_to(-160,160) 160 | # fillcolor('#ffd700') 161 | # begin_fill() 162 | circle(30, 360) 163 | # a=1 164 | # for i in range(120): 165 | # if 0<=i<30 or 60<=i<90: 166 | # a=a+0.2 167 | # lt(3) 168 | # forward(a) 169 | # else: 170 | # a=a-0.2 171 | # lt(3) 172 | # forward(a) 173 | # end_fill() 174 | 175 | def face(): 176 | eye() 177 | nose() 178 | mouth() 179 | tooth() 180 | # hole() 181 | 182 | def body(): 183 | go_to(-170,-180) 184 | seth(-120) 185 | circle(150, 30) 186 | seth(0) 187 | forward(40) 188 | seth(100) 189 | forward(35) 190 | seth(-80) 191 | forward(100) 192 | fillcolor('brown') 193 | begin_fill() 194 | seth(0) 195 | forward(300) 196 | seth(80) 197 | forward(110) 198 | seth(-100) 199 | forward(65) 200 | seth(180) 201 | forward(315) 202 | go_to(-118,-400) 203 | end_fill() 204 | go_to(-170,-255) 205 | fillcolor('yellow') 206 | begin_fill() 207 | seth(-75) 208 | forward(80) 209 | seth(0) 210 | forward(17) 211 | seth(105) 212 | forward(85) 213 | end_fill() 214 | 215 | go_to(200, -170) 216 | seth(-60) 217 | circle(-150,30) 218 | seth(-180) 219 | forward(45) 220 | begin_fill() 221 | seth(0) 222 | forward(20) 223 | seth(-100) 224 | forward(85) 225 | seth(180) 226 | forward(20) 227 | end_fill() 228 | 229 | def tie(): 230 | go_to(-50,-225) 231 | seth(-40) 232 | forward(40) 233 | seth(30) 234 | forward(52) 235 | go_to(30,-225) 236 | seth(-30) 237 | forward(40) 238 | seth(40) 239 | forward(45) 240 | fillcolor('red') 241 | go_to(0, -240) 242 | begin_fill() 243 | seth(-60) 244 | forward(10) 245 | seth(0) 246 | forward(30) 247 | seth(60) 248 | forward(15) 249 | go_to(30,-225) 250 | end_fill() 251 | go_to(4,-250) 252 | begin_fill() 253 | seth(-100) 254 | forward(80) 255 | seth(0) 256 | forward(55) 257 | seth(100) 258 | forward(80) 259 | end_fill() 260 | 261 | def spongeBob(): 262 | # help_do() 263 | head() 264 | face() 265 | body() 266 | tie() 267 | 268 | if __name__=='__main__': 269 | screensize(800, 600, 'white') 270 | pensize(3) 271 | speed(10) 272 | go_to(0, 0) 273 | spongeBob() 274 | mainloop() 275 | --------------------------------------------------------------------------------