Commit 994d8539 authored by Andrew M. Kuchling's avatar Andrew M. Kuchling

Choose the smallest value of x,y for the clock's radius (instead of just taking the

    y coordinate), and change radius of second indicator to compensate
Remove redundant setting of sradius
parent 49d27c82
...@@ -80,17 +80,13 @@ def main(win): ...@@ -80,17 +80,13 @@ def main(win):
cx = (curses.COLS - 1) / 2 cx = (curses.COLS - 1) / 2
cy = curses.LINES / 2 cy = curses.LINES / 2
if cx > cy: ch = min( cy-1, int(cx / ASPECT) - 1)
ch = cy mradius = (3 * ch) / 4
else: hradius = ch / 2
ch = cx sradius = 5 * ch / 6
mradius = (3 * cy) / 4
hradius = cy / 2
sradius = (2 * cy) / 3
for i in range(0, 12): for i in range(0, 12):
sangle = (i + 1) * 2.0 * pi / 12.0 sangle = (i + 1) * 2.0 * pi / 12.0
sradius = 5 * cy / 6
sdx, sdy = A2XY(sangle, sradius) sdx, sdy = A2XY(sangle, sradius)
stdscr.addstr(cy - sdy, cx + sdx, "%d" % (i + 1)) stdscr.addstr(cy - sdy, cx + sdx, "%d" % (i + 1))
...@@ -98,7 +94,8 @@ def main(win): ...@@ -98,7 +94,8 @@ def main(win):
stdscr.addstr(0, 0, stdscr.addstr(0, 0,
"ASCII Clock by Howard Jones <ha.jones@ic.ac.uk>, 1994") "ASCII Clock by Howard Jones <ha.jones@ic.ac.uk>, 1994")
sradius = 8 sradius = max(sradius-4, 8)
while 1: while 1:
curses.napms(1000) curses.napms(1000)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment