Esempio n. 1
0
def espiral(comp_min, comp_max, passo, angulo):
    """
    Desenho de espirais por justaposi��o de segmentos de recta que 
    v�o rodando de um certo �ngulo. Assumo sentido crescente e rota��o
    id�ntica � dos ponteiros do rrel�gio.
    """
    cTurtle.down()
    for segmento in range(comp_min, comp_max, passo):
        cTurtle.forward(segmento)
        cTurtle.right(angulo)
    cTurtle.up()
    cTurtle.hideturtle()
Esempio n. 2
0
def espiral(comp_min, comp_max, passo, angulo):
    """
    Desenho de espirais por justaposi��o de segmentos de recta que 
    v�o rodando de um certo �ngulo. Assumo sentido crescente e rota��o
    id�ntica � dos ponteiros do rrel�gio.
    """
    cTurtle.down()
    for segmento in range(comp_min, comp_max, passo):
        cTurtle.forward(segmento)
        cTurtle.right(angulo)
    cTurtle.up()
    cTurtle.hideturtle()
Esempio n. 3
0
def desenha_enforcado(i):
    cTurtle.up()
    if(i==0):
        cTurtle.goto(60,-90)
        cTurtle.setheading(180)
        cTurtle.down()
        cTurtle.forward(130)
        cTurtle.right(90)
        cTurtle.forward(160)
        cTurtle.right(90)
        cTurtle.forward(70)
        cTurtle.right(90)
        cTurtle.forward(20)
        cTurtle.up()
        cTurtle.goto(-70,50)
        cTurtle.down()
        cTurtle.goto(-50,70)
    elif(i==1):
        cTurtle.goto(-20,30)
        cTurtle.down()
        cTurtle.circle(20)
    elif(i==2):
        cTurtle.goto(0,10)
        cTurtle.down()
        cTurtle.goto(0,-30)
    elif(i==3):
        cTurtle.goto(0,0)
        cTurtle.down()
        cTurtle.goto(-20,-10)
    elif(i==4):
        cTurtle.goto(0,0)
        cTurtle.down()
        cTurtle.goto(20,-10)
    elif(i==5):
        cTurtle.goto(0,-30)
        cTurtle.down()
        cTurtle.goto(-20,-70)
        cTurtle.goto(-30,-70)
    elif(i==6):
        cTurtle.goto(0,-30)
        cTurtle.down()
        cTurtle.goto(20,-70)
        cTurtle.goto(30,-70)
    cTurtle.hideturtle()
def desenha_enforcado(i):
    cTurtle.up()
    if(i==0):
        cTurtle.goto(60,-90)
        cTurtle.setheading(180)
        cTurtle.down()
        cTurtle.forward(130)
        cTurtle.right(90)
        cTurtle.forward(160)
        cTurtle.right(90)
        cTurtle.forward(70)
        cTurtle.right(90)
        cTurtle.forward(20)
        cTurtle.up()
        cTurtle.goto(-70,50)
        cTurtle.down()
        cTurtle.goto(-50,70)
    elif(i==1):
        cTurtle.goto(-20,30)
        cTurtle.down()
        cTurtle.circle(20)
    elif(i==2):
        cTurtle.goto(0,10)
        cTurtle.down()
        cTurtle.goto(0,-30)
    elif(i==3):
        cTurtle.goto(0,0)
        cTurtle.down()
        cTurtle.goto(-20,-10)
    elif(i==4):
        cTurtle.goto(0,0)
        cTurtle.down()
        cTurtle.goto(20,-10)
    elif(i==5):
        cTurtle.goto(0,-30)
        cTurtle.down()
        cTurtle.goto(-20,-70)
        cTurtle.goto(-30,-70)
    elif(i==6):
        cTurtle.goto(0,-30)
        cTurtle.down()
        cTurtle.goto(20,-70)
        cTurtle.goto(30,-70)
    cTurtle.hideturtle()