Sign in Join
Wiki copytemporary

Easter date/de: what changed

Revision 2 to 3. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
1-**Deutsch (de)**
1+Zurück zur Seite [[code examples/de|Code Beispiele]].
22
3-
4-Zurück zur Seite [[code examples/de|Code Beispiele]].
3+Dieses Beispiel berechnet das Osterdatum (Ostersonntag) der Westkirchen nach der Formel von Carl Friedrich Gauß für den Zeitraum von 1583 - 8702.
54
6-
7-Dieses Beispiel berechnet das Osterdatum (Ostersonntag) der Westkirchen nach der Formel von Carl Friedrich Gauß für den Zeitraum von 1583 - 8702.
8-```
5+``` pascal
96uses
10- SysUtils, DateUtils, Dialogs;
11-
12- ...
13-
14- function funOstersonntag(wrdJahr: word): TDate;
15- // Osterfunktion nach Carl Friedrich Gauß (1800). Rückgabewert
16- // ist das Datum des Ostersonntags im angegebenen Jahr
17- // Gültigkeitsbereich: 1583 - 8702
18- var
19- a: integer;
20- b: integer;
21- c: integer;
22- d: integer;
23- e: integer;
24- f: integer;
25- wrdTage: word;
26- wrdMonat: word;
27-
28- begin
29-
30- // Prüft, ob das Jahr korrekt ist
31- if wrdJahr < 1583 then
32- begin
33- ShowMessage('Das Jahr ist zu klein und liegt vor dem Jahr 1583.');
34- Exit;
35- end;
36-
37- if wrdJahr > 8702 then
38- begin
39- ShowMessage('Das Jahr ist zu groß und liegt nach dem Jahr 8702.');
40- Exit;
41- end;
42-
43- // Die Gauss-Formel
44- a := wrdJahr mod 19;
45- b := wrdJahr div 100;
46- c := (8 * b + 13) div 25 - 2;
47- d := b - (wrdJahr div 400) - 2;
48- e := (19 * (wrdJahr mod 19) + ((15 - c + d) mod 30)) mod 30;
49-
50- if e = 28 then
51- if a > 10 then
52- e := 27
53- else if e = 29 then
54- e := 28;
55-
56- f := (d + 6 * e + 2 * (wrdJahr mod 4) + 4 * (wrdJahr mod 7) + 6) mod 7;
57-
58- if (e + f + 22) > 31 then
59- begin
60- wrdMonat := 4;
61- wrdTage := ((e + f + 22) - 31);
62- end
63- else
64- begin
65- wrdMonat := 3;
66- wrdTage := (e + f + 22);
67- end;
68-
69- // Rückgabewert als Datum bereitstellen
70- Result := EncodeDate(wrdJahr, wrdMonat, wrdTage);
71-
72- end;
7+ SysUtils, DateUtils, Dialogs;
8+
9+ ...
10+
11+function funOstersonntag(wrdJahr: word): TDate;
12+ // Osterfunktion nach Carl Friedrich Gauß (1800). Rückgabewert
13+ // ist das Datum des Ostersonntags im angegebenen Jahr
14+ // Gültigkeitsbereich: 1583 - 8702
15+var
16+ a: integer;
17+ b: integer;
18+ c: integer;
19+ d: integer;
20+ e: integer;
21+ f: integer;
22+ wrdTage: word;
23+ wrdMonat: word;
24+
25+begin
26+
27+ // Prüft, ob das Jahr korrekt ist
28+ if wrdJahr < 1583 then
29+ begin
30+ ShowMessage('Das Jahr ist zu klein und liegt vor dem Jahr 1583.');
31+ Exit;
32+ end;
33+
34+ if wrdJahr > 8702 then
35+ begin
36+ ShowMessage('Das Jahr ist zu groß und liegt nach dem Jahr 8702.');
37+ Exit;
38+ end;
39+
40+ // Die Gauss-Formel
41+ a := wrdJahr mod 19;
42+ b := wrdJahr div 100;
43+ c := (8 * b + 13) div 25 - 2;
44+ d := b - (wrdJahr div 400) - 2;
45+ e := (19 * (wrdJahr mod 19) + ((15 - c + d) mod 30)) mod 30;
46+
47+ if e = 28 then
48+ if a > 10 then
49+ e := 27
50+ else if e = 29 then
51+ e := 28;
52+
53+ f := (d + 6 * e + 2 * (wrdJahr mod 4) + 4 * (wrdJahr mod 7) + 6) mod 7;
54+
55+ if (e + f + 22) > 31 then
56+ begin
57+ wrdMonat := 4;
58+ wrdTage := ((e + f + 22) - 31);
59+ end
60+ else
61+ begin
62+ wrdMonat := 3;
63+ wrdTage := (e + f + 22);
64+ end;
65+
66+ // Rückgabewert als Datum bereitstellen
67+ Result := EncodeDate(wrdJahr, wrdMonat, wrdTage);
68+
69+end;
7370```
7471
7572---
76-*From the Free Pascal wiki, page "Easter date/de", as the Internet Archive kept it on 2022-09-28. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*
73+*From the Free Pascal wiki, page "Easter date/de", as it stood on 2020-02-14 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*
74+Category: Code Snippets/de
75+Category: Deutsch
76+Category: Mathe/de

Back to history