lunes, 16 de octubre de 2017

Turtle Ejemplos y Barquito

from turtle import *

setup(640, 480, 0, 0) #crear ventana turtledone()




from turtle import *

setup(450, 200, 0, 0)
screensize(300, 150)

goto(100, 50)
done()


from turtle import *

setup(450, 200, 0, 0)
screensize(300, 150)

goto(100, 50)
goto(100, -50)
goto(50, -50)
done()



from turtle import *

setup(450, 200, 0, 0)
screensize(300, 150)

goto(100, 50)
sety(-50)
setx(50)
setx(0)
sety(50)
setx(100)
goto(50,-50)
goto(0,0)
goto(50,50)
goto(100,0)
goto(50,-50)
hideturtle()
done()

from turtle import *

setup(450, 200, 0, 0)
screensize(300, 150)

goto(100, 50)
penup()
goto(100, -50)
pendown()
goto(50, -50)
done()



from turtle import *

setup(450, 200, 0, 0)
screensize(300, 150)

goto(100, 50)
pensize(4)
goto(100, -50)
pensize(8)
goto(50, -50)
done()

from turtle import *

setup(450, 200, 0, 0)
screensize(300, 150)
colormode(255)

pencolor(255, 0, 0)
goto(100, 50)
pencolor(0, 255, 0)
goto(100, -50)
pencolor(0, 0, 255)
goto(50, -50)
done()


from turtle import *

setup(600, 600, 0, 0)
screensize(1300, 1300)
penup()
goto(50,300)
pendown()
fillcolor("brown")
begin_fill()
goto(150,200)
goto(400,200)
goto(500,300)
end_fill()
fillcolor("pink")
goto(300,300)
begin_fill()
goto(300,500)
goto(450,350)
goto(300,350)
end_fill()
fillcolor("pink")
goto(300,500)
goto(275,500)
goto(275,600)
goto(225,550)
goto(275,550)
goto(275,500)
goto(250,500)
begin_fill()
goto(100,350)
goto(250,350)
end_fill()
goto(250,500)
goto(250,300)
goto(50,300)
penup()
goto(300,300)
fillcolor("#663300")
begin_fill()
goto(300,500)
goto(250,500)
goto(250,300)
end_fill()
done()






No hay comentarios:

Publicar un comentario