sábado, 21 de octubre de 2017

Turtle 19 Octubre

Programa 1

from turtle import*
import tkSimpleDialog

speed(10)

shape("turtle")
vueltas=30
a=tkSimpleDialog.askstring("Hola", "Color de fondo")
b=tkSimpleDialog.askstring("Hola","Dame color de relleno")
pluma=tkSimpleDialog.askinteger("Numero de pixeles"," grosor Pluma")

bgcolor(a)
pensize(pluma)
fillcolor(b)

begin_fill()
cont=0for i in range(vueltas):
    if cont > 14:
        clear(); cont=0; i=1; vueltas=1;

    begin_fill()
    rt(90)
    fd(200)
    lt(120)
    fd(200)
    lt(120)
    fd(200)
    end_fill()

    cont= cont+1    print vueltas

exitonclick()


Programa 2
from turtle import*
import tkSimpleDialog

speed(10)
shape("turtle")

c=tkSimpleDialog.askstring("Hola", "Color de fondo")
a=tkSimpleDialog.askstring("Hola","Dame color de relleno")
vueltas=tkSimpleDialog.askinteger("Numero de figuras","figuras")
pluma=tkSimpleDialog.askinteger("Numero de pixeles"," grosor Pluma")

bgcolor(c)
pensize(pluma)
fillcolor(a)

cont=0a=90b=200c=120
for i in range(vueltas):
    begin_fill()
    rt(90)
    fd(200)
    lt(120)
    fd(200)
    lt(120)
    fd(200)
    end_fill()
    cont= cont+1

exitonclick()


Programa 3

from turtle import*
import tkSimpleDialog

speed(10)
shape("turtle")

c=tkSimpleDialog.askstring("Hola", "Color de fondo")
a=tkSimpleDialog.askstring("Hola","Dame color de relleno")
vueltas=tkSimpleDialog.askinteger("Numero de figuras","figuras")
pluma=tkSimpleDialog.askinteger("Numero de pixeles"," grosor Pluma")

bgcolor(c)
pensize(pluma)
fillcolor(a)

cont=0a=90b=200c=120
for i in range(vueltas):
    if cont >8:
        clear(); cont=0; i=1; vueltas=1;
    begin_fill()
    rt(90)
    fd(200)
    lt(120)
    fd(200)
    lt(120)
    fd(200)
    end_fill()
    cont= cont+1
exitonclick()




No hay comentarios.:

Publicar un comentario