home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / compsrcs / misc / volume04 / paaske < prev    next >
Encoding:
Internet Message Format  |  1991-08-27  |  2.4 KB

  1. From decwrl!labrea!rutgers!tut.cis.ohio-state.edu!cwjcc!hal!ncoast!allbery Sat Oct 15 18:26:16 PDT 1988
  2. Article 665 of comp.sources.misc:
  3. Path: granite!decwrl!labrea!rutgers!tut.cis.ohio-state.edu!cwjcc!hal!ncoast!allbery
  4. From: ns@pr1me.dk.UUCP ( Sales Support)
  5. Newsgroups: comp.sources.misc
  6. Subject: v04i123: Calculate Eastern for given year
  7. Keywords: calendar, month
  8. Message-ID: <704@pr1me.dk>
  9. Date: 14 Oct 88 23:33:30 GMT
  10. Sender: allbery@ncoast.UUCP
  11. Reply-To: ns@pr1me.dk.UUCP ( Sales Support)
  12. Organization: Prime Computer A/S, Copenhagen, Denmark
  13. Lines: 62
  14. Approved: allbery@ncoast.UUCP
  15.  
  16. Posting-number: Volume 4, Issue 123
  17. Submitted-by: " Sales Support" <ns@pr1me.dk.UUCP>
  18. Archive-name: paaske
  19.  
  20. I'm using the month-program for my appointments written by
  21.   Origional Author:    Tom Stoehn@Tektronics[zeus!tims]
  22.   Modifications by:    Marc Ries@TRW[trwrb!ries]
  23.             Niels S|ndergaard, Prime Denmark
  24.             (made Danish version)
  25.  
  26. in addition to translateting to danish I also found reason to put in
  27. calculation of hollydays, in order to calculate the hollydays you need
  28. to find out what date Eastern sunday is, I found an algoritm in a book
  29. which Title I forgot by an author which name I also forgot, but I
  30. don't think there is any Copyrigth left as the book was from 1754. I
  31. coded and tested this routine from 1754 to 2037 (where I could verify
  32. the results) and found the algoritm correct.
  33.  
  34. /* Udregn Paaske S|ndag for givent aar */
  35. /* Calculate Eastern Sunday for given year */
  36. /* Copyrigth (c) 1988, Prime Computer Inc. Mass.
  37.    this program can be copied, distributed and used to any purpose.
  38.    Prime Computer Inc, has no warrenty for any kind of damage done
  39.    by using this program or the results from it */
  40.  
  41. int day,month;
  42. int paaske(year)
  43. int year;
  44. {
  45.     int register b;
  46.     int a,c,d,e,f,g,h,i,j,k,l,m,n,p,x;
  47.  
  48.     a= year%19;
  49.     b=year/100;
  50.     c=year%100;
  51.     d=b/4;
  52.     e=b%4;
  53.     f = (b + 8)/25;
  54.     g = (b - f + 1)/3;
  55.     h = ((19 * a) + b - d - g + 15)%30;
  56.     i = c/4;
  57.     k = c%4;
  58.     l = ((2*e) + (2*i) + 32 - h -k)%7;
  59.     m = (a + (11*h) + (22*l))/451;
  60.     x=  (h + l - (7*m) + 114);
  61.     n = x/31;
  62.     p = x%31;
  63.     day = p + 1;
  64.     month= n;
  65. }
  66.  
  67.  
  68. --
  69.  Med Venlig Hilsen (With Kind Regards)
  70.  Niels S|ndergaard,
  71.  Prime Computer A/S, Denmark.
  72.  ns@pr1me.dk, {...}!mcvax!dkuug!pr1me!ns   or  ns@cph-d.Prime.COM
  73. -- 
  74.  Med Venlig Hilsen (With Kind Regards)
  75.  Niels S|ndergaard,
  76.  Prime Computer A/S, Denmark.
  77.  ns@pr1me.dk, {...}!mcvax!dkuug!pr1me!ns   or  ns@cph-d.Prime.COM
  78.  
  79.  
  80.