2016-04-02 3 views
0

Pythonでフィボナッチスパイラルが多く見えますが、それでもどのように見えますか?PythonでFIbbonaciらせんをもっと見るには?

import time 
import turtle 
a = turtle.Turtle() 
x = 0 
y = 0.01 
while 0==0 : 
    a.forward(y) 
    x = x + y 
    a.left(90) 
    a.forward(x) 
    y = x + y 
    a.left(90) 
    time.sleep(0.02) 

答えて

2
import time 
import turtle 
a = turtle.Turtle() 
x = 0 
y = 10 
factor = 0.55 
while True: 
    a.forward (y) 
    x = factor * (x + y) 
    a.left(90) 
    a.forward (x) 
    y = factor * (x + y) 
    a.left (90) 
    time.sleep (0.02) 

enter image description here

: は、ここでは、コードです
関連する問題