线画笔随机移动的线条

python pen line random move线画笔随机移动的线条

python pen line random move线画笔随机移动的线条

"""
   线画笔随机移动的线条,本例中所有的对象都是画出来的。
   
"""
import math
from turtle import *
from random import *

def main():

    screen = Screen()
    screen.setup(480,360)
    screen.tracer(0,0)
    screen.title("线画笔随机移动的线条by lixingqiu")

    Line((0,0),100,0)    
    Line((0,0),90,0)
    Line((0,0),80,0)
    Line((0,0),70,0)
    Line((0,0),60,0)
    Line((0,0),50,0)
    Line((0,0),40,0)
    Line((0,0),30,0)

class Line:
    """定义一根线条类"""
    def __init__(self,a,length,angle):
        """
          a:首端点
          length:长度
          angle:角度
        """   
        

You must log in to read the rest of this article. Please log in or register as a user.