~ubuntu-branches/debian/lenny/fpc/lenny

« back to all changes in this revision

Viewing changes to packages/extra/amunits/demos/easter.pas

  • Committer: Bazaar Package Importer
  • Author(s): Mazen Neifer, Torsten Werner, Mazen Neifer
  • Date: 2008-05-17 17:12:11 UTC
  • mfrom: (3.1.9 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080517171211-9qi33xhd9evfa0kg
Tags: 2.2.0-dfsg1-9
[ Torsten Werner ]
* Add Mazen Neifer to Uploaders field.

[ Mazen Neifer ]
* Moved FPC sources into a version dependent directory from /usr/share/fpcsrc
  to /usr/share/fpcsrc/${FPCVERSION}. This allow installing more than on FPC
  release.
* Fixed far call issue in compiler preventing building huge binearies.
  (closes: #477743)
* Updated building dependencies, recomennded and suggested packages.
* Moved fppkg to fp-utils as it is just a helper tool and is not required by
  compiler.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Program easter;
2
 
 
3
 
{
4
 
    easter v1.0
5
 
    � 1995 by Andreas Tetzl
6
 
    FREEWARE
7
 
 
8
 
    
9
 
    This is a little program to calculate the date of
10
 
    easter for years between 1583 and 2299.
11
 
 
12
 
    Start it in a shell with the year as argument.
13
 
 
14
 
}
15
 
 
16
 
{
17
 
    Translated to fpc pascal.
18
 
    21 Mar 2001.
19
 
 
20
 
    nils.sjoholm@mailbox.swipnet.se
21
 
}
22
 
 
23
 
uses amigados;
24
 
 
25
 
const version : pchar = '$VER: easter v1.0 (3-Nov-95) by Andreas Tetzl';
26
 
 
27
 
VAR i,a,b,c,d,e,m,n : Integer;
28
 
    year, month, day : longint;
29
 
 
30
 
 
31
 
BEGIN
32
 
 
33
 
  if (ParamStr(1) = '?') or (ParamStr(1) = '') then
34
 
   BEGIN
35
 
    Writeln('YEAR/N');
36
 
    halt(20);
37
 
   END;
38
 
 
39
 
  i:=StrToLong(ParamStr(1),year);
40
 
  if (year<1583) or (year>2299) then
41
 
   BEGIN
42
 
    Writeln('only years between 1583 and 2299 allowed');
43
 
    halt(20);
44
 
   END;
45
 
 
46
 
  Case year of
47
 
    1583..1699 : BEGIN m:=22; n:=2; END;
48
 
    1700..1799 : BEGIN m:=23; n:=3; END;
49
 
    1800..1899 : BEGIN m:=23; n:=4; END;
50
 
    1900..2099 : BEGIN m:=24; n:=5; END;
51
 
    2100..2199 : BEGIN m:=24; n:=6; END;
52
 
    2200..2299 : BEGIN m:=25; n:=0; END;
53
 
  end;
54
 
 
55
 
  a:=year mod 19;
56
 
  b:=year mod 4;
57
 
  c:=year mod 7;
58
 
  d:=(19*a+m) mod 30;
59
 
  e:=(2*b+4*c+6*d+n) mod 7;
60
 
 
61
 
  day:=22+d+e;
62
 
  if day<=31 then
63
 
   month:=3
64
 
  else
65
 
   BEGIN
66
 
    month:=4;
67
 
    day:=d+e-9;
68
 
   END;
69
 
 
70
 
  if (month=4) and (day=26) then day:=19;
71
 
  if (month=4) and (day=25) and (d=28) and (e=6) and (a>10) then day:=18;
72
 
 
73
 
  Write(year,'-');
74
 
  if month=3 then Write('Mar') else Write('Apr');
75
 
  Writeln('-',day);
76
 
END.
77
 
 
78
 
{
79
 
  $Log: easter.pas,v $
80
 
  Revision 1.1  2002/11/28 19:42:26  nils
81
 
    * initial release
82
 
 
83
 
}
84
 
 
85
 
  
 
 
b'\\ No newline at end of file'