, 1994")
sradius = max(sradius-4, 8)
while True:
curses.napms(1000)
tim = time.time()
t = time.localtime(tim)
hours = t[3] + t[4] / 60.0
if hours > 12.0:
hours -= 12.0
mangle = t[4] * 2 * pi / 60.0
mdx, mdy = A2XY(mangle, mradius)
hangle = hours * 2 * pi / 12.0
hdx, hdy = A2XY(hangle, hradius)
sangle = t[5] * 2 * pi / 60.0
sdx, sdy = A2XY(sangle, sradius)
dline(3, cx, cy, cx + mdx, cy - mdy, ord('#'))
stdscr.attrset(curses.A_REVERSE)
dline(2, cx, cy, cx + hdx, cy - hdy, ord('.'))
stdscr.attroff(curses.A_REVERSE)
if curses.has_colors():
stdscr.attrset(curses.color_pair(1))
plot(cx + sdx, cy - sdy, ord('O'))
if curses.has_colors():
stdscr.attrset(curses.color_pair(0))
stdscr.addstr(curses.LINES - 2, 0, time.ctime(tim))
stdscr.refresh()
if (t[5] % 5) == 0 and t[5] != lastbeep:
lastbeep = t[5]
curses.beep()
ch = stdscr.getch()
if ch == ord('q'):
return 0
plot(cx + sdx, cy - sdy, ord(' '))
dline(0, cx, cy, cx + hdx, cy - hdy, ord(' '))
dline(0, cx, cy, cx + mdx, cy - mdy, ord(' '))
curses.wrapper(main)