Correzioni

* Sistemati errori di gioventù.
This commit is contained in:
Rnhmjoj 2013-07-08 01:41:34 +02:00
parent 65808e093e
commit 0357e4848f
2 changed files with 14 additions and 9 deletions

View File

@ -1,4 +1,4 @@
import frattali, turtle
import turtle, frattali
frattali.impostazioni()

View File

@ -26,7 +26,8 @@ class koch(frattale):
def disegna(self, l=3, s=250, n=4, p=1):
spigolo = 2 * s * math.sin(math.pi/l)
self.posizione(s,0)
if self.riempi == True: self.begin_fill()
if self.riempi == True:
self.begin_fill()
self.rt(180 - (90 * (l-2) / l))
for i in range(l):
self.curva(spigolo, n, p)
@ -51,9 +52,11 @@ class hilbert(frattale):
def disegna(self, s=4, n=6, p=1):
self.posizione(-33*s*p,-33*s*p)
if self.riempi == True: self.begin_fill()
if self.riempi == True:
self.begin_fill()
self.curva(s, n, p)
if self.riempi == True: self.end_fill()
if self.riempi == True:
self.end_fill()
self.posizione(0,0)
def curva(self, s, n, p):
@ -76,12 +79,14 @@ class sierpinski(frattale):
def disegna(self, n, s=400, x=-200, y=-150):
self.posizione(x, y)
if n==1:
if self.riempi == True: self.begin_fill()
if self.riempi == True:
self.begin_fill()
for i in range(3):
self.fd(s)
self.lt(120)
if self.riempi == True: self.end_fill()
if self.riempi == True:
self.end_fill()
else:
sierpinski.disegna(self, n-1, s/2, x, y)
sierpinski.disegna(self, n-1, s/2, x+s/2, y)
sierpinski.disegna(self, n-1, s/2, x+s/4, y+(s*((3)**0.5))/4)
self.disegna(n-1, s/2, x, y)
self.disegna(n-1, s/2, x+s/2, y)
self.disegna(n-1, s/2, x+s/4, y+(s*((3)**0.5))/4)