We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 49d27c8 commit 994d853Copy full SHA for 994d853
1 file changed
Demo/curses/tclock.py
@@ -80,25 +80,22 @@ def main(win):
80
81
cx = (curses.COLS - 1) / 2
82
cy = curses.LINES / 2
83
- if cx > cy:
84
- ch = cy
85
- else:
86
- ch = cx
87
- mradius = (3 * cy) / 4
88
- hradius = cy / 2
89
- sradius = (2 * cy) / 3
+ ch = min( cy-1, int(cx / ASPECT) - 1)
+ mradius = (3 * ch) / 4
+ hradius = ch / 2
+ sradius = 5 * ch / 6
90
91
for i in range(0, 12):
92
sangle = (i + 1) * 2.0 * pi / 12.0
93
- sradius = 5 * cy / 6
94
sdx, sdy = A2XY(sangle, sradius)
95
96
stdscr.addstr(cy - sdy, cx + sdx, "%d" % (i + 1))
97
98
stdscr.addstr(0, 0,
99
"ASCII Clock by Howard Jones <ha.jones@ic.ac.uk>, 1994")
100
101
- sradius = 8
+ sradius = max(sradius-4, 8)
+
102
while 1:
103
curses.napms(1000)
104
0 commit comments