import random
import os
from palettes import randomPalette
from util import getTurtleAndScreen
# Lines
# CAC, 3/27/2023

def Draw():
    numLines = random.randint(50,400)

    title = "Lines (Different Widths) "+str(numLines)
    width = 800
    height = 600
    filename = os.path.basename(__file__)[0:-3]
    turtle, screen = getTurtleAndScreen(title,width,height,filename,moveWorld=True)

    colors = randomPalette()
    bg = random.choice(colors)
    screen.bgcolor(bg)
    colors.remove(bg)


    for i in range(0,numLines):
        x1=random.randint(-20,width+20)
        y1=random.randint(-20,height+20)
        x2=random.randint(-20,width+20)
        y2=random.randint(-20,height+20)

        lineWidth = random.randint(1, 20)
        turtle.pensize(lineWidth)

        turtle.color(random.choice(colors))
        turtle.penup()
        turtle.goto(x1,y1)
        turtle.pendown()
        turtle.goto(x2,y2)

    screen.mainloop()
# ----------------------------------------------------------------
if __name__ == '__main__':
   Draw()
