[Python-checkins] CVS: python/dist/src/Demo/curses tclock.py,1.1,1.2

A.M. Kuchling python-dev@python.org
Sat, 23 Dec 2000 06:50:21 -0800


Update of /cvsroot/python/python/dist/src/Demo/curses
In directory usw-pr-cvs1:/tmp/cvs-serv28253

Modified Files:
	tclock.py 
Log Message:
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


Index: tclock.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Demo/curses/tclock.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** tclock.py	2000/12/15 00:41:48	1.1
--- tclock.py	2000/12/23 14:50:18	1.2
***************
*** 81,95 ****
      cx = (curses.COLS - 1) / 2
      cy = curses.LINES / 2
!     if cx > cy:
!         ch = cy
!     else:
!         ch = cx
!     mradius = (3 * cy) / 4
!     hradius = cy / 2
!     sradius = (2 * cy) / 3
  
      for i in range(0, 12):
          sangle = (i + 1) * 2.0 * pi / 12.0
-         sradius = 5 * cy / 6
          sdx, sdy = A2XY(sangle, sradius)
  
--- 81,91 ----
      cx = (curses.COLS - 1) / 2
      cy = curses.LINES / 2
!     ch = min( cy-1, int(cx / ASPECT) - 1) 
!     mradius = (3 * ch) / 4
!     hradius = ch / 2
!     sradius = 5 * ch / 6
  
      for i in range(0, 12):
          sangle = (i + 1) * 2.0 * pi / 12.0
          sdx, sdy = A2XY(sangle, sradius)
  
***************
*** 99,103 ****
                    "ASCII Clock by Howard Jones <ha.jones@ic.ac.uk>, 1994")
  
!     sradius = 8
      while 1:
          curses.napms(1000)
--- 95,100 ----
                    "ASCII Clock by Howard Jones <ha.jones@ic.ac.uk>, 1994")
  
!     sradius = max(sradius-4, 8)
!     
      while 1:
          curses.napms(1000)