Give me a good names for this project: import turtle, math, random, re def main():…
- User
Give me a good names for this project: import turtle, math, random, re
def main(): number_of_art_ids = 4 art_id = get_num(f"Enter art id from 1-{number_of_art_ids}: ", 1, number_of_art_ids) speed = get_num(f"fastest: 0, fast: 10, normal 6, slow: 3, slowest: 1: ", 0, 10) colors = get_colors()
codeturtle.speed(speed) match art_id: case 1: first(colors) case 2: second(colors) case 3: third(colors) case 4: x, y = get_num("Enter x: "), get_num("Enter y: ") fourth(colors, x, y, 1) turtle.mainloop()def get_num(prompt: str, min_value = float("-inf"), max_value= float("inf")) -> int|None: while True: try: num = int(input(prompt)) if num <= max_value and num >= min_value: return num raise ValueError(f"Number must be in the range of okay{min_value}-{max_value}") except: raise ValueError
def get_colors()->list: colors = ["black"] while True: color = input("add a color or exit with (exit): ") if re.match("exit", color, re.I): return colors try: turtle.color(color) if color not in colors: colors.append(color) except: pass
def change_color(colors: list)->str: color = colors[random.randrange(0, len(colors))] if not color: turtle.color("black") return "black" turtle.color(color) return color
def first(colors)-> None: for i in range (0,100): change_color(colors) turtle.forward(i+i+200) turtle.left(i+90)
def second(colors: list)-> None: for i in range(100): change_color(colors)
turtle.setpos(math.cos(i) * 100, math.sin(i) * 100) turtle.setpos(math.cos(i), 100 * math.sin(i)) turtle.setpos(0, 0)def third(colors: list)-> None: i = 0 while i <= math.pi*2: change_color(colors)
reset_point = (math.cos(i) * 100, math.sin(i) * 100)codeturtle.setpos(reset_point[0] , reset_point[1]) turtle.setpos(reset_point[0] + 50, reset_point[1]) if i <= math.pi: turtle.setpos(reset_point[0] + 50, reset_point[1] + 100) turtle.setpos(reset_point[0] - 50, reset_point[1] + 100) else: turtle.setpos(reset_point[0] + 50, reset_point[1] - 100) turtle.setpos(reset_point[0] - 50, reset_point[1] - 100) turtle.setpos(reset_point[0] - 50, reset_point[1]) turtle.setpos(reset_point[0] , reset_point[1]) turtle.setpos(0, 0) i+=0.05 - Assistant
Sure! Here are several creative and fitting names for your turtle-based art project, along with brief explanations for each:
-
TurtleArtistry
- Explanation: Combines "Turtle" with "Artistry" to emphasize the creative aspect of your project.
-