clock.py
def draw_clock_face(ascii_canvas, radius, mark_char):
    """
    Draw clock face with hour and minute marks
    """
    x0 = ascii_canvas.cols // 2
    y0 = ascii_canvas.lines // 2
    # draw marks first
    for mark in range(1, 12 * 5 + 1):
        x1 = x0 + int(math.cos((mark + 45) * 6 * math.pi / 180) * radius * x_scale_ratio)
        y1 = y0 + int(math.sin((mark + 45) * 6 * math.pi / 180) * radius)
        if mark % 5 != 0:
            ascii_canvas.add_text(x1, y1, mark_char)
    # start from 1 because at 0 index - 12 hour
    for mark in range(1, 12 + 1):
        x1 = x0 + int(math.cos((mark + 45) * 30 * math.pi / 180) * radius * x_scale_ratio)
        y1 = y0 + int(math.sin((mark + 45) * 30 * math.pi / 180) * radius)
        ascii_canvas.add_text(x1, y1, '%s' % mark)

    Draw clock face with hour and minute marks
    
Draw clock face with hour and minute marks
Draw clock face with hour and minute marks
def draw_clock_face(ascii_canvas, radius, mark_char):
    x0 = ascii_canvas.cols // 2
    y0 = ascii_canvas.lines // 2
    for mark in range(1, 12 * 5 + 1):
        x1 = x0 + int(math.cos((mark + 45) * 6 * math.pi / 180) * radius * x_scale_ratio)
        y1 = y0 + int(math.sin((mark + 45) * 6 * math.pi / 180) * radius)
        if mark % 5 != 0:
            ascii_canvas.add_text(x1, y1, mark_char)
    for mark in range(1, 12 + 1):
        x1 = x0 + int(math.cos((mark + 45) * 30 * math.pi / 180) * radius * x_scale_ratio)
        y1 = y0 + int(math.sin((mark + 45) * 30 * math.pi / 180) * radius)
        ascii_canvas.add_text(x1, y1, '%s' % mark)
def draw_clock_face ( ascii_canvas , radius , mark_char ) : x0 = ascii_canvas . cols // 2 y0 = ascii_canvas . lines // 2 for mark in range ( 1 , 12 * 5 + 1 ) : x1 = x0 + int ( math . cos ( ( mark + 45 ) * 6 * math . pi / 180 ) * radius * x_scale_ratio ) y1 = y0 + int ( math . sin ( ( mark + 45 ) * 6 * math . pi / 180 ) * radius ) if mark % 5 != 0 : ascii_canvas . add_text ( x1 , y1 , mark_char ) for mark in range ( 1 , 12 + 1 ) : x1 = x0 + int ( math . cos ( ( mark + 45 ) * 30 * math . pi / 180 ) * radius * x_scale_ratio ) y1 = y0 + int ( math . sin ( ( mark + 45 ) * 30 * math . pi / 180 ) * radius ) ascii_canvas . add_text ( x1 , y1 , '%s' % mark )
Draw clock face with hour and minute marks
Draw clock face with hour and minute marks
"""
    Draw clock face with hour and minute marks
    """ # draw marks first # start from 1 because at 0 index - 12 hour
ascii_canvas
radius
mark_char