当前位置: 首页>>代码示例>>Python>>正文


Python turtle.fd函数代码示例

本文整理汇总了Python中turtle.fd函数的典型用法代码示例。如果您正苦于以下问题:Python fd函数的具体用法?Python fd怎么用?Python fd使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了fd函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: drawSootSprite

def drawSootSprite(N, R):
    # reset direction
    turtle.reset()
    # draw star
    drawStar(N, R)
    # draw body
    turtle.dot(0.8*2*R)
    # draw right eyeball
    turtle.fd(0.2*R)
    turtle.dot(0.3*R, 'white')
    # draw right pupil
    turtle.pu()
    turtle.bk(0.1*R)
    turtle.pd()
    turtle.dot(0.05*R)
    turtle.pu()
    # centre
    turtle.setpos(0, 0)
    # draw left eyeball
    turtle.bk(0.2*R)
    turtle.pd()
    turtle.dot(0.3*R, 'white')
    # draw left pupil
    turtle.pu()
    turtle.fd(0.1*R)
    turtle.pd()
    turtle.dot(0.05*R)

    turtle.hideturtle()
开发者ID:circulocity,项目名称:tp10,代码行数:29,代码来源:sootsprite.py

示例2: takieCos

def takieCos(n):
    rotateUpwards = [0, 3, 4]
    rot = -90

    for j in range(0,2):
        # for j in range(0,2):
        turtle.fd(1.5*n)
        turtle.rt(-90)
        turtle.fd(n)
        turtle.rt(90)
        turtle.fd(n)
        turtle.rt(90)
        turtle.fd(n)
        turtle.rt(-90)
        turtle.fd(1.5*n)
        if (j in rotateUpwards):
            turtle.rt(-90)
        else:
            turtle.rt(90)
    turtle.rt((-1)*rot)
    # turtle.rt(180)


    takieCos(n)
    raw_input()
开发者ID:Cube189,项目名称:WdPPyth,代码行数:25,代码来源:zad1beta.py

示例3: drawSide

def drawSide(l):
    """
        Draw one side of the hexagon.
        l is side length
    """
    turtle.fd(l)
    turtle.rt(60)
开发者ID:ArthuruhtrA,项目名称:Fall-2014,代码行数:7,代码来源:hexes-full.py

示例4: koch

def koch(size, n):
    if n == 0:
        turtle.fd(size)
    else:
        for angle in [0, 60, -120, 60]:
            turtle.left(angle)
            koch(size/3, n-1)
开发者ID:BrandonSherlocking,项目名称:python_document,代码行数:7,代码来源:科赫曲线绘制.py

示例5: ustNaStart

def ustNaStart(r):
    turtle.lt(90)
    turtle.pu()
    turtle.rt(90)
    turtle.fd(r)
    turtle.lt(90)
    turtle.pd()
开发者ID:ujanlabs,项目名称:miniLogia_Py,代码行数:7,代码来源:Zadanie_2.py

示例6: jeden

def jeden():
    turtle.fd(50)
    turtle.fillcolor(randint(0,255),randint(0,255),randint(0,255))
    turtle.begin_fill()
    kwadrat(50)
    turtle.end_fill()
    turtle.bk(50)
开发者ID:ujanlabs,项目名称:miniLogia_Py,代码行数:7,代码来源:Zadanie_3.py

示例7: draw_l

def draw_l(word):
    turtle.up()
    turtle.clear()
    turtle.setposition(0, 0)
    turtle.setheading(0)
    turtle.bk(INITIAL_POS[0])
    turtle.down()
    turtle.st()
    stack = []
    for char in word:
        if char == '0':
            turtle.fd(SIZE[0])
        if char == '1':
            turtle.fd(SIZE[0])
        if char == '[':
            stack.append((turtle.position(), turtle.heading()))
            turtle.lt(45)
        if char == ']':
            position, heading = stack.pop()
            turtle.up()
            turtle.setposition(position)
            turtle.setheading(heading)
            turtle.rt(45)
            turtle.down()
    turtle.ht()
开发者ID:RichardBarrell,项目名称:snippets,代码行数:25,代码来源:draw_l.py

示例8: ustDoKwadratu

def ustDoKwadratu(dlBokKw):
    turtle.pu()
    turtle.fd(dlBokKw * 2)
    turtle.lt(90)
    turtle.fd(dlBokKw * 2)
    turtle.lt(90)
    turtle.pd()
开发者ID:ujanlabs,项目名称:miniLogia_Py,代码行数:7,代码来源:Zadanie_4.py

示例9: skidMark

def skidMark(lineLength):
    turtle.pensize(2)
    turtle.pencolor(0, 0, 0)
    for x in range(lineLength):
        turtle.pencolor(x,x,x)
        turtle.fd(x)
        turtle.right(90)
开发者ID:KrbAlmryde,项目名称:Homework,代码行数:7,代码来源:Lab3.py

示例10: ustDoElki

def ustDoElki(dlBokKw, bokKr):
    turtle.pu()
    turtle.fd(bokKr - dlBokKw)
    turtle.lt(90)
    turtle.fd(dlBokKw)
    turtle.lt(90)
    turtle.pd()
开发者ID:ujanlabs,项目名称:miniLogia_Py,代码行数:7,代码来源:Zadanie_4.py

示例11: ustDo2Elki

def ustDo2Elki(dlBokKw, bokKr, bokDl):
    turtle.pu()
    turtle.fd(bokKr - dlBokKw *2)
    turtle.rt(90)
    turtle.fd(bokDl - dlBokKw*2)
    turtle.rt(90)
    turtle.pd()
开发者ID:ujanlabs,项目名称:miniLogia_Py,代码行数:7,代码来源:Zadanie_4.py

示例12: ustNaStart

def ustNaStart(a):
    turtle.pu()
    turtle.bk(a)
    turtle.lt(90)
    turtle.fd(a / 2)
    turtle.rt(90)
    turtle.pd()
开发者ID:ujanlabs,项目名称:miniLogia_Py,代码行数:7,代码来源:Zadanie_1.py

示例13: kwadrat

def kwadrat(kolor): #kwadrat
    t.fillcolor(kolor)
    t.begin_fill()
    for i in range(4):
        t.fd(B)
        t.rt(90)
    t.end_fill()
开发者ID:chinski99,项目名称:minilogia,代码行数:7,代码来源:owoc.py

示例14: drawStar

def drawStar(N, R):
    turtle.reset()
    a = 360/N
    for i in range(N):
        turtle.fd(R)
        turtle.bk(R)
        turtle.left(a)
开发者ID:circulocity,项目名称:tp10,代码行数:7,代码来源:sootsprite.py

示例15: okoP

def okoP(a):
    turtle.begin_fill()
    wielokat(6, a *4, 4)
    turtle.end_fill()
    turtle.rt(180)
    turtle.fd(a * 4)
    turtle.lt(360 / 6)
    turtle.fd(a * 4)
    turtle.lt(360 / 6)
    turtle.fd(a * 4)
    turtle.colormode(255)
    turtle.fillcolor(255, 255, 255)
    turtle.rt(180)
    turtle.fd(a)
    turtle.rt(120)
    turtle.begin_fill()
    wielokat(6, 2 * a, 4)
    turtle.end_fill()
    turtle.rt(60)
    turtle.fd(a / 2)
    turtle.rt(120)
    turtle.fillcolor(0, 0, 0)
    turtle.begin_fill()
    wielokat(6, a, 4)
    turtle.end_fill()
开发者ID:ujanlabs,项目名称:miniLogia_Py,代码行数:25,代码来源:Zadanie_1.py


注:本文中的turtle.fd函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。