Fejezet 4, 5

This commit is contained in:
2021-12-07 11:16:57 +01:00
parent b234874262
commit b7f1716b79
6 changed files with 85 additions and 0 deletions

29
fejezet 4/rajzolás.py Normal file
View File

@@ -0,0 +1,29 @@
import turtle
a = turtle.Screen()
a.bgcolor('green')
a.title('Negyzet')
teknos = turtle.Turtle()
teknos.shape('turtle')
teknos.speed(100)
teknos.color('black')
def negyzet(t, n):
for i in range(4):
t.forward(n)
t.left(90)
n = 20
x = 0
y = 0
for i in range(5):
negyzet(teknos, n)
n += 20
x += -10
y += -10
teknos.penup()
teknos.goto(x, y)
teknos.pendown()
a.mainloop()

21
fejezet 4/rajzolás2.py Normal file
View File

@@ -0,0 +1,21 @@
import turtle
def negyzet(t):
for i in range(4):
t.forward(100)
t.left(90)
ablak = turtle.Screen()
ablak.title("Gyönyörű minta")
ablak.bgcolor("green")
teknos = turtle.Turtle()
teknos.color("blue")
teknos.pensize(3)
teknos.speed(10)
for i in range(20):
negyzet(teknos)
teknos.left(18)
ablak.mainloop()

0
fejezet 4/rajzolás3.py Normal file
View File