Turtle
008_Arcs.py
import random
import os
from colors import randomPaletteColor
from drawMethods import drawCircle
from util import getTurtleAndScreen
# Arcs
# CAC, 3/2023
def Draw():
title = "Goofy looking Arcs that I am not sure I like"
width = 800
height = 600
cellSize = 50
numCols = width // cellSize
numRows = height // cellSize
filename = os.path.basename(__file__)[0:-3]
turtle, screen = getTurtleAndScreen(title,width,height,filename,moveWorld=True)
bg = randomPaletteColor()
screen.bgcolor(bg)
for row in range (0,numRows):
for col in range(0,numCols):
radius = cellSize//2
x = col*cellSize + radius
y = row*cellSize + radius
color=randomPaletteColor()
turtle.color(color)
lineWidth = 2*random.randint(1,10)
extent = random.randint(90,360)
start = random.randint(0,359)
drawCircle(turtle,x,y,radius,lineWidth,extent,start)
#drawCircle(turtle,x,y,radius)
turtle.penup()
turtle.goto(0,0)
screen.mainloop()
# ----------------------------------------------------------------
if __name__ == '__main__':
Draw()
|