from turtle import*import tkSimpleDialog speed(10) shape("turtle") vueltas=30a=tkSimpleDialog.askstring("Porfavor dame", "Color de fondo") b=tkSimpleDialog.askstring("Porfavor 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()
Programa2
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=120for i in range(vueltas): begin_fill() rt(90) fd(200) lt(120) fd(200) lt(120) fd(200) end_fill() cont= cont+1 exitonclick()
Programa3
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=120for 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+1exitonclick()
No hay comentarios:
Publicar un comentario