예제 #1
1
def draw_circle(x,y):
	turtle.penup()
	turtle.goto(x,y)
	turtle.pendown()
	turtle.begin_fill()
	turtle.circle(10)
	turtle.end_fill()
예제 #2
0
def makeshape():
	B = 25				# base unit size
	turtle.begin_poly()
	turtle.fd(B)			# roof
	turtle.rt(45)
	turtle.fd(B * 3/4)		# windshield
	turtle.lt(45)
	turtle.fd(B)			# hood
	turtle.rt(90)
	turtle.fd(B * 3/4)		# front
	turtle.rt(90)
	turtle.fd(B * 1/7)
	turtle.lt(90)
	turtle.circle(-B/2, 180)	# front tire
	turtle.lt(90)
	turtle.fd(B)
	turtle.lt(90)
	turtle.circle(-B/2, 180)	# back tire
	turtle.lt(90)
	turtle.fd(B * 1/7)
	turtle.rt(90)
	turtle.fd(B * 5/6)		# back
	turtle.end_poly()
	poly = turtle.get_poly()
	turtle.register_shape('car', poly)
예제 #3
0
def sun():
	turtle.up()
	turtle.goto(50,200)
	turtle.begin_fill()
	turtle.color("Red")
	turtle.circle(75)
	turtle.end_fill()
예제 #4
0
def circunferencia(simbolos,identificador,linea):
  p1= obtener_punto(2,identificador,simbolos)
  radio = obtener_radio(identificador,simbolos)
  x1 = obtener_x(p1,simbolos)
  y1 = obtener_y(p1,simbolos)
 
  escalar = obtener_escalar(identificador, simbolos,linea)
  relleno = obtener_color(obtener_relleno(identificador,simbolos,linea))
  borde = obtener_color(obtener_borde(identificador,simbolos,linea))  
  turtle.color(borde)
  if escalar == 0:
    escalar=1
  tx = obtener_tx(identificador, simbolos,linea)
  ty = obtener_ty(identificador, simbolos,linea)
  turtle.pensize(8)
  turtle.penup()

  
  #Trasladar circunferencia
  x1 = x1 + tx
  y1 = y1 + ty

  #turtle.setposition(x1, y1-(radio*44))
  #turtle.pendown()
  #turtle.circle(radio*44)

  #Escalar circunferencia
  turtle.penup()
  #turtle.setposition(x1, y1-(radio*44*escalar))
  turtle.setposition(x1*44, (y1*44)-(radio*44*escalar))
  turtle.pendown()
  turtle.fillcolor(relleno)
  turtle.begin_fill()
  turtle.circle(radio*44*escalar)
  turtle.end_fill()
def displaySqaure(x, y):
    turtle.penup()
    turtle.goto(x - 100, y - 100)
    turtle.pendown()
    turtle.begin_fill()
    turtle.circle(50, steps=4)
    turtle.end_fill()
def polygon(side = 50, angle = None, xstart = None, ystart = None, numberSides = 3, color = 'black', fill = False):
    turtle.pensize(3)
    turtle.speed('fastest')
    turtle.hideturtle()
    if angle != None:
        turtle.left(angle)
    
    turtle.penup()
    if fill == True:
        if xstart != None or ystart != None:
            turtle.goto(xstart, ystart)
        else:
            turtle.goto(0, 0)
        turtle.color(color)
        turtle.pendown()
        turtle.begin_fill()
        turtle.circle(side, 360, numberSides)
        turtle.end_fill()
        turtle.penup()
        
    else:
        turtle.goto(xstart, ystart)
        turtle.color(color)
        turtle.pendown()
        turtle.circle(side, 360, numberSides)
        turtle.penup()
    
    return
예제 #7
0
def draw_figures(area: Number):
    """
    Plots figures of the same area
    :param area: Area of figures
    :return:Plot of figures
    """
    begin_fill()
    turtle.right(45)
    turtle.forward(sqrt(area))
    turtle.right(90)
    turtle.forward(sqrt(area))
    turtle.right(90)
    turtle.forward(sqrt(area))
    turtle.right(90)
    turtle.forward(sqrt(area))
    i = 0
    while (i < 4):
        turtle.forward(sqrt(area))
        turtle.left(90)
        i = i+1
    turtle.circle(sqrt(area/pi))
    turtle.forward(sqrt(2*area))
    turtle.left(135)
    turtle.forward(sqrt(2)*sqrt(2*area))
    turtle.left(135)
    turtle.forward(sqrt(2*area))

    turtle.done()
예제 #8
0
def circle(x,y,size):
	turtle.pu()
	turtle.goto(x,y)
	turtle.pd()
	turtle.begin_fill()
	turtle.circle(size)
	turtle.end_fill()
def drawPoint(x, y): 
    turtle.penup() # Pull the pen up
    turtle.goto(x, y)
    turtle.pendown() # Pull the pen down
    turtle.begin_fill() # Begin to fill color in a shape
    turtle.circle(3) 
    turtle.end_fill() # Fill the shape
예제 #10
0
def rand_circle():
    color = choice(colors)
    turtle.color(color, color)
    radius = randint(10, 100)
    turtle.begin_fill()
    turtle.circle(radius)
    turtle.end_fill()
예제 #11
0
def draw_circle(x,y,r,t):
    t.pu()
    t.goto(x+r,y)
    t.setheading(90)
    t.pd()
    t.circle(r)
    t.pu()
예제 #12
0
파일: one.py 프로젝트: cparker/pythonclub
def drawCircleAt(turtleX, turtleY, circleSize):
    turtle.penup()
    turtle.goto(turtleX,turtleY)
    turtle.pendown()
    turtle.begin_fill()
    turtle.circle(circleSize)
    turtle.end_fill()
예제 #13
0
 def b(turtle):
     from math import sqrt
     turtle.color("black")
     l = 5/sqrt(2)
     turtle.forward(l)
     turtle.circle(l, 270)
     turtle.forward(l)
def circle(a,b):
    turtle.color("green")
    turtle.pu()
    turtle.goto(a,b)
    turtle.pd()
    turtle.setheading(90)
    turtle.circle(40)
예제 #15
0
def house():
    turtle.forward(100)
    turtle.left(90)
    turtle.forward(50)
    turtle.left(90)
    turtle.forward(100)
    turtle.left(90)
    turtle.forward(50)
    turtle.left(180)
    turtle.forward(50)
    turtle.right(90)
    turtle.forward(100)
    turtle.left(90)
    turtle.circle(50, 180)
    turtle.forward(50)
    turtle.left(90)
    turtle.forward(20)
    turtle.left(90)
    turtle.forward(30)
    turtle.right(90)
    turtle.forward(20)
    turtle.right(90)
    turtle.forward(30)
    turtle.right(90)
    turtle.forward(40)
    turtle.right(180)
예제 #16
0
파일: snack.py 프로젝트: RIT-2015/CPS
def drawEyes():
    """
    Draw the pair of eyes.
    :pre: (relative) pos (0,0), heading (east), up
    :post: (relative) pos (0,0), heading (east), up
    :return: None
    """
    # left eye
    turtle.forward(10)
    turtle.left(90)
    turtle.forward(10)
    turtle.right(90)
    turtle.down()
    turtle.begin_fill()
    turtle.circle(5)
    turtle.end_fill()
    turtle.up()

    # right eye
    turtle.forward(30)
    turtle.down()
    turtle.begin_fill()
    turtle.circle(5)
    turtle.end_fill()
    turtle.up()

    # return back
    turtle.back(30)
    turtle.left(90)
    turtle.back(10)
    turtle.right(90)
    turtle.back(10)
예제 #17
0
def plansza(bok):
    bokMalKw = bok/7
    rDuzKol = bokMalKw
    rMalKol = bokMalKw/2
    numPowPlus = 1
    numPowKola = 1
    ustNaStart(bok)
    turtle.pu() ##W figurach nie ma krawędzi
    duzyKwadrat(bok)
    ustDoPlusa(bokMalKw)
    while numPowPlus <= 4:
        plus(bokMalKw, rMalKol)
        turtle.rt(90)
        turtle.fd(bokMalKw)
        numPowPlus = numPowPlus + 1
    ustDoKol(bokMalKw)
    turtle.fillcolor(250, 250, 0)
    while numPowKola <= 4:
        turtle.rt(90)
        turtle.fd(bokMalKw)
        turtle.lt(180)
        turtle.begin_fill()
        turtle.circle(rDuzKol)
        turtle.end_fill()
        turtle.lt(180)
        turtle.fd(bokMalKw * 6)
        numPowKola = numPowKola + 1
    turtle.pd()
예제 #18
0
def drawPaintBoard():
	turtle.shape("triangle")
	turtle.penup()
	turtle.color("red")
	fillRect(0 - width,0 + height,30 -width,30 +height)
	turtle.color("blue")
	fillRect(30-width,height,60-width,30+height)
	turtle.color("#000000")
	drawRect(width,height,width-30,30+height)
	drawRect(width-30,height,width-60,height+30)
	turtle.penup()
	turtle.goto(width-15,height)
	turtle.pendown()
	turtle.circle(15)
	fillRect(width-60,height,width-90,height+30)
	drawRect(width-90,height,width-120,height+30)
	turtle.penup()
	turtle.goto(width-105,height)
	turtle.pendown()
	turtle.begin_fill()
	turtle.circle(15)
	turtle.end_fill()
	turtle.penup()
	drawRect(-15,height,15,height+30)
	turtle.goto(0,height)
	drawCursor()
	drawEraser()
	turtle.color("blue")
예제 #19
0
def DrawCircle(x, y, radius):
    turtle.penup()
    turtle.goto(x + radius, y)
    turtle.setheading(90)
    turtle.pendown()
    turtle.circle(radius)
    turtle.penup
예제 #20
0
def drawBorder():
    """Draw a circle for the outline of the thingy. that is a circle of radius 100"""
    turtle.right( 90 )
    turtle.down()
    turtle.circle( 100 )
    turtle.up()
    turtle.left( 90 )
def drawTree(x,t,Max,houseLoc):
    global count
    if(t=='Maple'):
        trunkLen=random.uniform(50,150)
        trunk(trunkLen)
        turtle.pencolor("green")
        turtle.circle(20,360)
        turtle.pencolor("black")
        turtle.right(90)
        netHeight=trunkLen+60
        Max.append(netHeight)
        if(count<x):
            InitPos(trunkLen)
        else:
            turtle.penup()
            turtle.forward(trunkLen)
            turtle.left(90)
        if(count==houseLoc):
            buildHouse()
            count=count+1
        else:
            count=count+1
            return count

    elif(t=='Pine'):
        trunkLen=random.uniform(50,200)
        trunk(trunkLen)
        triangle()
        turtle.right(90)
        netHeight=trunkLen+17.3
        Max.append(netHeight)
        if(count<x):
            InitPos(trunkLen)
        else:
            turtle.penup()
            turtle.forward(trunkLen)
            turtle.left(90)
        if(count==houseLoc):
            buildHouse()
            count=count+1
        else:
            count=count+1

    else:
        trunkLen=random.uniform(50,200)
        trunk(trunkLen)
        DifferentShape()
        netHeight=trunkLen+20
        Max.append(netHeight)
        if(count<x):
            InitPos(trunkLen)
        else:
            turtle.penup()
            turtle.forward(trunkLen)
            turtle.left(90)
        if(count==houseLoc):
            buildHouse()
            count=count+1
        else:
            count=count+1
예제 #22
0
파일: neural2.py 프로젝트: glutzic/bob
	def doDraw(self, turtle):
		turtle.pu()
		turtle.setpos(self.x, self.y)
		turtle.begin_fill()
		turtle.circle(self.radius)
		turtle.end_fill()
		return
예제 #23
0
def stam(x,y):
    turtle.begin_fill()
    turtle.pu()
    turtle.goto(x,y)
    turtle.pd()
    turtle.circle(10)
    turtle.end_fill()
예제 #24
0
def drawFlower(xCenter = 0, yCenter = 0, xRightUp = 0, yRightUp = 0,
    xRightDown = 0, yRightDown = 0, xLeftUp = 0, yLeftUp = 0,
    xLeftDown = 0, yLeftDown = 0, radius = 10):
    turtle.pensize(3)
    turtle.color(1.0, 0.41, 0.70) # Hot Pink
    turtle.penup()
    turtle.goto(xCenter, yCenter - radius)
    turtle.pendown()
    turtle.circle(radius)
    turtle.penup()
    turtle.goto(xRightUp, yRightUp - radius)
    turtle.pendown()
    turtle.circle(radius)
    turtle.penup()
    turtle.goto(xRightDown, yRightDown - radius)
    turtle.pendown()
    turtle.circle(radius)
    turtle.penup()
    turtle.goto(xLeftUp, yLeftUp - radius)
    turtle.pendown()
    turtle.circle(radius)
    turtle.penup()
    turtle.goto(xLeftDown, yLeftDown - radius)
    turtle.pendown()
    turtle.circle(radius)
예제 #25
0
def hang():
	turtle.speed(0)
	if stage[0]==0:
		go_to(-300,0,0)
		turtle.forward(600)
		go_to(-100,0, 90)
		turtle.forward(200)
		turtle.right(90)
		turtle.forward(100)
		turtle.right(90)
		turtle.forward(25)
	elif stage[0]==1:
		go_to(0, 150, 0)
		turtle.circle(12.5)
	elif stage[0]==2:
		go_to(0,150, -90)
		turtle.forward(50)
	elif stage[0]==3:
		go_to(0,140, -45)
		turtle.forward(25)
		go_to(0,140, -135)
		turtle.forward(25)
	elif stage[0]==4:
		go_to(0,100, -45)
		turtle.forward(25)
		go_to(0,100, -135)
		turtle.forward(25)
	stage[0]+=1
	return 0
예제 #26
0
def draw_move(turtle, cell_size, offset, domino, dx, dy, move_num, step_count):
    shade = (move_num-1) * 1.0/step_count
    rgb = (0, 1-shade, shade)
    turtle.forward((domino.head.x-offset[0]) * cell_size)
    turtle.left(90)
    turtle.forward((domino.head.y-offset[1]) * cell_size)
    turtle.right(90)
    turtle.setheading(domino.degrees)
    turtle.forward(cell_size*.5)
    turtle.setheading(math.atan2(dy, dx) * 180/math.pi)
    pen = turtle.pen()
    turtle.pencolor(rgb)
    circle_pos = turtle.pos()
    turtle.width(4)
    turtle.forward(cell_size*0.05)
    turtle.down()
    turtle.forward(cell_size*0.4)
    turtle.up()
    turtle.pen(pen)
    turtle.setpos(circle_pos)
    turtle.forward(8)
    turtle.setheading(270)
    turtle.forward(8)
    turtle.left(90)
    turtle.down()
    turtle.pencolor(rgb)
    turtle.fillcolor('white')
    turtle.begin_fill()
    turtle.circle(8)
    turtle.end_fill()
    turtle.pen(pen)
    turtle.write(move_num, align='center')
    turtle.up()
예제 #27
0
def drawCircle(x = 0, y = 0, radius = 10, mycolor = (0.49, 0.99, 0.00)): # Lawn Green
    turtle.pencolor(mycolor[0], mycolor[1], mycolor[2])
    turtle.pensize(4)
    turtle.penup()
    turtle.goto(x, y - radius)
    turtle.pendown()
    turtle.circle(radius)
예제 #28
0
파일: py_eg.py 프로젝트: flyerooo/learnpy
def drawPoint(x, y):
    turtle.penup()
    turtle.goto(x, y)
    turtle.pendown()
    turtle.begin_fill()
    turtle.circle(3)
    turtle.end_fill()
예제 #29
0
파일: ex09.py 프로젝트: strommer/Python_rpi
	def display(self):
		turtle.penup()
		print(self.x, self.y)
		turtle.goto(self.x,self.y)
		turtle.pendown()
		turtle.circle(self.r)
		turtle.penup()
예제 #30
0
 def draw(self):
     turtle.forward(self.radius)
     turtle.left(90)
     turtle.circle(self.radius, extent=self.angle)
     turtle.left(90)
     turtle.forward(self.radius)
     turtle.done()
예제 #31
0
파일: star.py 프로젝트: Nstremmel/projects
import turtle as t
from time import sleep
from random import randint
import random
import os

t.speed("fastest")
x = 1

while True:
    #t.pensize(x)
    t.circle(30)
    t.fd(30 + x)
    t.right(150)
    x += 2
예제 #32
0
def DegreeCurve(n, r, d=1):
    for i in range(n):
        t.left(d)
        t.circle(r, abs(d))
예제 #33
0
import turtle as t
for i in range(1, 40):
    t.color('black')
    t.forward(200)
    t.right(90)
    t.speed(100)
    t.color('red')
    t.circle(i)

t.goto(-60, -60)

for j in range(1, 20):
    t.forward(150)
    t.speed(10)
    t.left(135)
예제 #34
0
import turtle
turtle.shape("turtle")
turtle.pensize(10)
turtle.circle(100)
turtle.penup()
turtle.home()
turtle.goto(250,0)
turtle.pendown()
turtle.color("red")
turtle.circle(100)
turtle.penup()
turtle.home()
turtle.sety(-100)
turtle.setx(125)
turtle.pendown()
turtle.color("green")
turtle.circle(100)
turtle.penup()
turtle.home()
turtle.sety(-100)
turtle.setx(-125)
turtle.pendown()
turtle.color("yellow")
turtle.circle(100)
turtle.penup()
turtle.home()
turtle.setx(-250)
turtle.pendown()
turtle.color("blue")
turtle.circle(100)
예제 #35
0
#!/usr/bin/python3.5
#-*- codig:UTF-8 -*-
import turtle
turtle.reset()
turtle.speed(0)
turtle.tracer(0)
turtle.width(2)
turtle.color('red')
#face
turtle.up()
turtle.goto(0, -150)
#face_draw
turtle.down()
turtle.begin_fill()
turtle.circle(180)
turtle.end_fill()
#nose
turtle.up()
turtle.goto(-5, 120)
#nose_draw
turtle.down()
turtle.color('maroon')
turtle.goto(-15, 0)
turtle.right(90)
turtle.circle(15, 180)
turtle.goto(5, 120)
turtle.up()
#

turtle.goto(-125, -40)
turtle.down()
예제 #36
0
"""
简单绘图工具
"""
import turtle

# 笔画控制命令
# 速度
turtle.speed(0)

# 运动命令
turtle.forward(100)  # 前进
turtle.backward(100)
turtle.circle(100)  # 圆
turtle.circle(100, steps=5)  # 五边形,steps表示多少笔画完
# 开始填充
turtle.begin_fill()
# 填充
turtle.fillcolor("blue")
turtle.circle(100, steps=5)  # 五边形,steps表示多少笔画完
# 结束填充
turtle.end_fill()

# 其他命令
# turtle.done()
예제 #37
0
'''

import turtle as t

t.title("苦涩")

t.pensize(5)
t.speed(10)
#脸
t.pencolor("orange")
t.begin_fill()
t.penup()
t.goto(0,-200)
t.pendown()
t.fillcolor("Yellow1")
t.circle(200)
t.end_fill()

#嘴

t.pencolor("brown")
t.penup()
t.goto(-70,-70)
t.pendown()
t.right(30)
t.circle(100,60)



#左眼
t.penup()
예제 #38
0
#Draw_winnoer.py
import turtle as t
t.setup(800, 500)
t.pensize(4)
for i in range(4):
    t.seth(270 * i)
    t.fd(150)
    t.right(90)
    t.circle(-150,45)
    t.goto(0,0)
import turtle
turtle.setup(900, 1200, 200, 200)
turtle.penup()
turtle.fd(-50)
turtle.pendown()
turtle.pensize(5)
turtle.pencolor("violet")
turtle.seth(360)
turtle.circle(10, 360)
s = 50
for i in range(8):
    s = 50 + i * 40
    turtle.pencolor("violet")
    turtle.seth(270)
    turtle.fd(5)
    turtle.pencolor("white")
    turtle.seth(270)
    turtle.fd(35)
    turtle.pencolor("violet")
    turtle.seth(0)
    turtle.circle(s, 360)
예제 #40
0
        t.left(d)
        t.circle(r, abs(d))


# 初始位置设定
s = 0.2  # size
t.setup(450 * 5 * s, 750 * 5 * s)
t.pencolor("black")
t.fillcolor("red")
t.speed(100)
t.penup()
t.goto(0, 900 * s)
t.pendown()
# 绘制花朵形状
t.begin_fill()
t.circle(200 * s, 30)
DegreeCurve(60, 50 * s)
t.circle(200 * s, 30)
DegreeCurve(4, 100 * s)
t.circle(200 * s, 50)
DegreeCurve(50, 50 * s)
t.circle(350 * s, 65)
DegreeCurve(40, 70 * s)
t.circle(150 * s, 50)
DegreeCurve(20, 50 * s, -1)
t.circle(400 * s, 60)
DegreeCurve(18, 50 * s)
t.fd(250 * s)
t.right(150)
t.circle(-500 * s, 12)
t.left(140)
예제 #41
0
#!/usr/bin/python3
# written by: atholcomb
# turtle.py

import turtle

turtle.goto(0, 50)

turtle.penup()
turtle.goto(50, -50)
turtle.pendown()

turtle.color("red")
turtle.circle(50)

# mainloop
turtle.mainloop()
예제 #42
0
import turtle

turtle.width(3)
turtle.shape('turtle')
turtle.shapesize(1, 1, 1)

turtle.circle(20)
turtle.color('yellow')
turtle.bk(100)
turtle.fd(300)

turtle.up()
turtle.goto(20, 20)
turtle.down()
turtle.left(90)

turtle.color('red')
turtle.bk(100)
turtle.fd(300)

turtle.up()
turtle.goto(0, 40)
turtle.down()
turtle.left(90)

turtle.color('green')
turtle.bk(100)
turtle.fd(300)

turtle.up()
turtle.goto(-20, 20)
예제 #43
0
import turtle as t

t.pensize(4)
t.pencolor('green')
t.circle(100,None,5)
t.penup()
t.goto(-95,130)
t.pendown()
t.right(108)
t.circle(100,None,5)

t.done()
예제 #44
0
import turtle as t

#turtle.circle(radius, extent, steps=None)
#描述:以给定半径画圆
#参数:
#radius(半径):半径为正(负),表示圆心在画笔的左边(右边)画圆;
#extent(弧度) (optional);
#steps (optional) (做半径为radius的圆的内切正多边形,多边形边数为steps)。
            
t.circle(-20, 180)
t.forward(40)
t.right(90)
t.forward(40)
t.circle(-20, 180)
예제 #45
0
    turtle.begin_fill()
    turtle.color(color)
    turtle.pendown()
    for count2 in range(3):
        turtle.forward(50)
        turtle.left(90)
    turtle.end_fill()


turtle.shape("triangle")
turtle.penup()
turtle.goto(0, -150)
turtle.color('#ff6600')
turtle.begin_fill()
turtle.pendown()
turtle.circle(150)
turtle.penup()
turtle.end_fill()
turtle.left(180)
# The Teeth:
make_triangle(-35, -20, '#ffffff')
make_triangle(0, -20, '#ffffff')
make_triangle(35, -20, '#ffffff')
turtle.left(180)

# The Eyes:
make_triangle(-70, 50, '#ffffff')
make_triangle(0, 50, '#ffffff')

# The Stump:
make_square(-20, 125, '#663300')
예제 #46
0
turtle.forward(400)
turtle.right(90)
turtle.forward(400)
turtle.right(90)
turtle.forward(400)
turtle.right(90)
turtle.forward(400)
turtle.right(90)
turtle.end_fill()
turtle.penup()
turtle.home()
turtle.color("orange", "yellow")
turtle.begin_fill()
turtle.pensize(20)
turtle.setposition(0, -80)
turtle.pendown()
turtle.circle(80)
turtle.penup()
turtle.setposition(0, -130)
turtle.pendown()
turtle.circle(130)
turtle.penup()
turtle.setposition(0, -180)
turtle.pendown()
turtle.circle(180)
turtle.end_fill()
turtle.hideturtle()

#End the program loop
turtle.done()
예제 #47
0
def draw_other():
    move_pen(310, 440)
    pen_set(6, 255, 145, 192, 255, 145, 192)
    t.begin_fill()
    t.circle(3)
    t.end_fill()
    move_pen(330, 430)
    t.begin_fill()
    t.circle(3)
    t.end_fill()

    pen_set(6, 255, 145, 192, 255, 255, 255)
    move_pen(410, 425)
    t.begin_fill()
    t.circle(10)
    t.end_fill()
    move_pen(460, 395)
    t.begin_fill()
    t.circle(10)
    t.end_fill()

    pen_set(6, 0, 0, 0, 0, 0, 0)
    move_pen(405, 429)
    t.begin_fill()
    t.circle(3)
    t.end_fill()
    move_pen(455, 399)
    t.begin_fill()
    t.circle(3)
    t.end_fill()

    move_pen(510, 310)
    pen_set(6, 255, 155, 192, 255, 155, 192)
    t.begin_fill()
    t.circle(25)
    t.end_fill()

    move_pen(410, 340)
    pen_set(6, 255, 145, 192, 255, 145, 192)
    a = -80
    for i in range(20):
        a = a + 6
        t.seth(a)
        t.fd(3)
    move_pen(430, 445)
    pen_set(4, 255, 155, 192, 255, 196, 218)
    t.begin_fill()
    a = 120
    for i in range(40):
        a = a - 2
        t.seth(a)
        t.fd(1.2)
    a = -a
    for i in range(45):
        a = a - 2
        t.seth(a)
        t.fd(1.2)
    t.end_fill()
    move_pen(480, 430)
    t.begin_fill()
    a = 70
    for i in range(40):
        a = a - 1.5
        t.seth(a)
        t.fd(1.5)
    a = -80
    for i in range(45):
        a = a - 1.5
        t.seth(a)
        t.fd(1.5)
    t.end_fill()
예제 #48
0
def draw_mud_pit():
    # 画泥坑
    pen_set(5, 130, 119, 100, 130, 119, 100)
    move_pen(350, 150)
    t.begin_fill()
    t.seth(-180)
    t.circle(50, 125)
    t.seth(-20)
    t.circle(350, 60)
    t.seth(20)
    t.circle(50, 30)
    t.seth(10)
    t.circle(50, 30)
    t.seth(0)
    t.circle(50, 30)
    t.seth(40)
    t.circle(50, 90)
    t.seth(170)
    t.circle(500, 45)
    t.end_fill()
예제 #49
0
파일: 小猪佩奇.py 프로젝트: Caaby/Notes
        t.fd(a)  #向前走a的步长
    else:
        a = a - 0.08
        t.lt(3)
        t.fd(a)
t.end_fill()  # 依据轮廓填充
t.pu()  # 提笔
t.seth(90)  # 笔的角度为90度
t.fd(25)  # 向前移动25
t.seth(0)  # 转换画笔的角度为0
t.fd(10)
t.pd()
t.pencolor(255, 155, 192)  # 设置画笔颜色
t.seth(10)
t.begin_fill()
t.circle(5)  # 画一个半径为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()
#头
t.color((255, 155, 192), "pink")
t.pu()
예제 #50
0
#exercise

import turtle
turtle.speed(10)
turtle.setup(500, 500, 100, 100)
turtle.penup()
turtle.right(90)
turtle.fd(30)
turtle.pendown()
turtle.pensize(5)
turtle.pencolor(0.93, 0.2, 0.54)

for i in range(25, 150):
    turtle.circle(2 * i, 20)

turtle.done()
예제 #51
0
def drawCircle(x = 0, y = 0, radius = 10):
    turtle.penup()
    turtle.goto(x, y - radius)
    turtle.pendown()
    turtle.circle(radius)
예제 #52
0
파일: demo4.py 프로젝트: jxh66601/python123
import turtle as t
t.setup(650,350,200,200)
t.penup()
t.fd(-250)
t.pendown()
t.pensize(25)
t.pencolor("purple")
t.seth(-40)
for i in range(4):
    t.circle(40,80)
    t.circle(-40,80)
t.circle(40,80/2)
t.fd(40)
t.circle(16,180)
t.fd(40*2/3)
t.done()
예제 #53
0
import turtle

# # would import a specific function from a module
# from turtle import forward

# # import the time module - allows for adaption of system time to a program
# import time

# python bug - cannot find turtle commands

# python remove error message comment:
# noinspection PyUnresolvedReferences
turtle.forward(150)

# # removes the need for turtle if a specific function
# forward(150)

# turn right 250 degrees
turtle.right(250)
# go forward 150
turtle.forward(150)

# turtle will draw a circle of radius 75
turtle.circle(75)

# will wait for user to terminate
turtle.done()

# # wait at this position for 4 seconds
# time.sleep(4)
예제 #54
0
def Jumper():
    t.pensize(2)
    t.pencolor('#0171b9')
    t.fillcolor('#84d4f7')
    t.forward(60)
    t.down()
    t.begin_fill()
    t.left(90)
    t.circle(60)
    t.end_fill()
    t.up()
    t.circle(60, 160)
    t.pencolor('#00c3f3')
    t.fillcolor('#00c3f3')
    t.left(25)
    t.down()
    t.begin_fill()
    t.circle(80, 90)
    t.pencolor('#0171b9')
    t.left(25)
    t.circle(60, -135)
    t.end_fill()
    t.up()
    t.left(45)
    t.forward(38)
    t.right(80)
    t.pencolor('#0171b9')
    t.fillcolor('#84d4f7')
    t.down()
    t.begin_fill()
    t.circle(5, -180)
    t.right(10)
    t.circle(-25, -40)
    t.left(50)
    t.back(10)
    t.left(80)
    t.circle(-20, 80)
    t.right(25)
    t.circle(-15, 60)
    t.circle(-40, 35)
    t.end_fill()
    t.up()
    t.pencolor('#02c2f4')
    t.fillcolor('#02c2f4')
    t.begin_fill()
    t.right(170)
    t.down()
    t.circle(30, 50)
    t.circle(7, 120)
    t.circle(15, 25)
    t.left(95)
    t.pencolor('#0171b9')
    t.back(6)
    t.left(80)
    t.circle(-20, 80)
    t.right(25)
    t.circle(-15, 60)
    t.circle(-40, 35)
    t.end_fill()
    t.up()
    t.right(90)
    t.forward(35)
    t.right(80)
    t.down()
    t.pencolor('#0171b9')
    t.fillcolor('#84d4f7')
    t.begin_fill()
    t.circle(35, 50)
    t.circle(5, 100)
    t.circle(60, 38)
    t.circle(5, 90)
    t.circle(40, 25)
    t.left(20)
    t.circle(30, 30)
    t.end_fill()
    t.up()
    t.left(150)
    t.forward(20)
    t.right(70)
    t.pencolor('#02c2f4')
    t.fillcolor('#02c2f4')
    t.down()
    t.begin_fill()
    t.circle(-16, 60)
    t.forward(13)
    t.right(28)
    t.pencolor('#0171b9')
    t.circle(-60, -23)
    t.circle(-5, -100)
    t.back(5)
    t.end_fill()
    t.up()
    t.left(70)
    t.forward(20)
    t.right(115)
    t.down()
    t.pencolor('#0171b9')
    t.fillcolor('#84d4f7')
    t.begin_fill()
    t.circle(30, 20)
    t.circle(7, 80)
    t.circle(65, 30)
    t.circle(5, 120)
    t.circle(60, 22)
    t.left(45)
    t.circle(-30, 30)
    t.end_fill()
    t.up()
    t.left(100)
    t.forward(2)
    t.down()
    t.pencolor('#02c2f4')
    t.fillcolor('#02c2f4')
    t.begin_fill()
    t.circle(15, 50)
    t.circle(30, 35)
    t.pencolor('#0171b9')
    t.left(16)
    t.circle(60, -25)
    t.right(20)
    t.circle(10, -120)
    t.end_fill()
    t.left(190)
    t.forward(5)
    t.up()
    t.right(7)
    t.forward(60)
    t.right(92)
    t.pencolor('#0171b9')
    t.fillcolor('#84d4f7')
    t.down()
    t.begin_fill()
    t.circle(-40, 20)
    t.circle(-9, 95)
    t.circle(-40, 20)
    t.right(130)
    t.circle(60, 30)
    t.end_fill()
    t.up()
    t.left(75)
    t.forward(117)
    t.pencolor('#0171b9')
    t.fillcolor('#84d4f7')
    t.down()
    t.begin_fill()
    t.left(10)
    t.circle(-65, 80)
    t.circle(-20, 185)
    t.right(180)
    t.circle(-65, -54)
    t.left(80)
    t.circle(60, 6)
    t.right(65)
    t.end_fill()
    t.pencolor('#02c2f4')
    t.fillcolor('#02c2f4')
    t.begin_fill()
    t.circle(-75, 65)
    t.circle(-30, 30)
    t.right(35)
    t.pencolor('#0171b9')
    t.circle(-20, -64)
    t.circle(-75, -65)
    t.end_fill()
    t.up()
    t.right(115)
    t.forward(25)
    t.left(95)
    t.pencolor('#0171b9')
    t.fillcolor('#84d4f7')
    t.down()
    t.begin_fill()
    t.circle(-40, 30)
    t.circle(-35, 170)
    t.circle(-13, 120)
    t.circle(-50, 40)
    t.circle(-50, -8)
    t.right(90)
    t.circle(-30, -60)
    t.end_fill()
    t.left(90)
    t.circle(60, 10)
    t.right(100)
    t.pencolor('#02c2f4')
    t.fillcolor('#02c2f4')
    t.down()
    t.begin_fill()
    t.circle(-60, 50)
    t.circle(-8, 40)
    t.circle(-40, 75)
    t.right(60)
    t.forward(5)
    t.right(40)
    t.circle(-45, 55)
    t.pencolor('#0171b9')
    t.right(20)
    t.circle(-40, -55)
    t.left(30)
    t.circle(-18, -60)
    t.left(15)
    t.circle(-30, -28)
    t.circle(-40, -70)
    t.left(15)
    t.circle(-40, -80)
    t.end_fill()
    t.up()
    t.right(40)
    t.back(17)
    t.pensize(4)
    t.down()
    t.circle(-10, 70)
    t.up()
    t.circle(-60, 20)
    t.right(20)
    t.down()
    t.circle(10, 70)
    t.up()
    t.pensize(2)
    t.fillcolor('white')
    t.right(150)
    t.forward(30)
    t.right(120)
    t.down()
    t.begin_fill()
    t.circle(30, 30)
    t.circle(15, 170)
    t.circle(30, 30)
    t.circle(13, 160)
    t.end_fill()
    t.begin_fill()
    t.right(70)
    t.circle(-30, 10)
    t.circle(-13, 110)
    t.circle(-30, 40)
    t.circle(-10, 150)
    t.left(30)
    t.circle(-20, 35)
    t.right(10)
    t.circle(40, 20)
    t.end_fill()
    t.back(20)
    t.pencolor('black')
    t.fillcolor('black')
    t.begin_fill()
    t.circle(-5, 490)
    t.end_fill()
    t.pencolor('white')
    t.fillcolor('white')
    t.begin_fill()
    t.circle(-2)
    t.end_fill()
    t.up()
    t.left(20)
    t.back(30)
    t.left(80)
    t.down()
    t.pencolor('black')
    t.fillcolor('black')
    t.begin_fill()
    t.circle(-5, 490)
    t.end_fill()
    t.pencolor('white')
    t.fillcolor('white')
    t.begin_fill()
    t.circle(-2)
    t.end_fill()
    t.up()
    t.pencolor('#f37694')
    t.fillcolor('#f37694')
    t.right(17)
    t.forward(23)
    t.down()
    t.begin_fill()
    t.circle(4)
    t.end_fill()
    t.up()
    t.pencolor('#0171b9')
    t.fillcolor('#ef4d40')
    t.left(10)
    t.forward(7)
    t.right(30)
    t.down()
    t.circle(-20, 25)
    t.up()
    t.right(65)
    t.back(25)
    t.down()
    t.begin_fill()
    t.left(27)
    t.circle(-40, 90)
    t.back(8)
    t.left(155)
    t.circle(30, 70)
    t.circle(6, 90)
    t.circle(-20, 40)
    t.up()
    t.right(90)
    t.forward(5)
    t.left(90)
    t.down()
    t.end_fill()
    t.up()
    t.left(120)
    t.forward(12)
    t.left(120)
    t.down()
    t.fillcolor('white')
    t.begin_fill()
    t.circle(-10, 150)
    t.right(40)
    t.circle(-20, 15)
    t.circle(-10, 25)
    t.end_fill()
    t.right(60)
    t.forward(20)
    t.back(10)
    t.right(80)
    t.circle(-10, 60)
    t.up()
    t.home()
예제 #55
0
def circle(radius):
    turtle.circle(radius)
    return
예제 #56
0
import turtle
turtle.Screen().setup(0.9, 0.9, 0, 0)
turtle.penup()
turtle.fd(-250)
turtle.pendown()
turtle.pensize(25)
turtle.pencolor("purple")
turtle.seth(-40)
for i in range(4):
    turtle.circle(40, 80)
    turtle.circle(-40, 80)
turtle.circle(40, 80/2)
turtle.fd(40)
turtle.circle(16, 180)
turtle.fd(40 * 2/3)
turtle.done()
예제 #57
0
def draw_letter_O():
    turtle.seth(0)
    turtle.forward(BOX_WIDTH / 2)
    turtle.pd()
    turtle.circle(BOX_WIDTH / 2)
    turtle.pu()
예제 #58
0
def draw_letter_G():
    draw_letter_C()
    turtle.circle(BOX_WIDTH / 2, 270)
    turtle.seth(180)
    turtle.forward(BOX_WIDTH / 2)
    turtle.pu()
예제 #59
0
turtle.penup()  

turtle.left(90)  

turtle.fd(200)  

turtle.pendown()  

turtle.right(90)
# 花蕊  

turtle.fillcolor("red")  

turtle.begin_fill()  

turtle.circle(10,180)  

turtle.circle(25,110)  

turtle.left(50)  

turtle.circle(60,45)  

turtle.circle(20,170)  

turtle.right(24)  

turtle.fd(30)  

turtle.left(10)  
예제 #60
0
def draw_letter_C():
    turtle.pu()
    turtle.setheading(0)
    turtle.forward(BOX_WIDTH / 2)
    turtle.pd()
    turtle.circle(BOX_WIDTH / 2, -180)