I added the numbers 1-12 on the clock. I struggled with finding the position of the numbers. In my next submit, I want to make the hands move like a clock, but I am afraid that I will not be able to get them to move over 60 seconds like a regular clock does.

This commit is contained in:
dpanarello2
2025-10-05 17:08:09 -04:00
parent 96519c0d67
commit 797ac491a5

View File

@@ -3,8 +3,8 @@
# By ____(you)___________
#
# (Briefly describe what this program does.)
import turtle
from turtle import *
def draw_clock():
screen = turtle.Screen()
screen.setup(width=600, height=600)
@@ -12,12 +12,23 @@ def draw_clock():
t = turtle.Turtle()
t.penup()
t.speed(0)
t.pensize(18)
t.pensize(14)
t.color("black")
t.goto(0, -200)
t.pendown()
RADIUS = 200
t.circle(RADIUS)
turtle.done()
NUMBER_RADIUS = RADIUS - 30
t = turtle.Turtle()
t.penup()
t.goto(5, -30)
t.pensize(20)
t.color("black")
for hour in range(1, 13):
angle = 30 * (3 - hour)
t.setheading(angle)
t.forward(NUMBER_RADIUS)
t.write(str(hour), align = "center", font = ("Arial", 50, "bold"))
t.backward(NUMBER_RADIUS)
draw_clock()
turtle.done()