home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1999 May
/
Chip_1999-05_cd.bin
/
ctenari
/
Lukas
/
Unit1.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1999-02-18
|
3KB
|
148 lines
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls, Buttons, MmSystem;
type
TForm1 = class(TForm)
Panel1: TPanel;
Panel2: TPanel;
Panel3: TPanel;
Panel4: TPanel;
Panel5: TPanel;
Panel6: TPanel;
Panel7: TPanel;
SpeedButton1: TSpeedButton;
SpeedButton2: TSpeedButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure SpeedButton2Click(Sender: TObject);
procedure SpeedButton1Click(Sender: TObject);
private
{ Private declarations }
public
rok,a,b,c,d,e,f,m: integer;
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
var
vstup : string;
begin
vstup:=InputBox('Vstup roku','VypoΦtu den velikonoc','Zadej rok');
rok:= Strtoint(vstup);
a:= rok mod 19;
b:= rok mod 4;
c:= rok mod 7;
d:=(19*a+24) mod 30;
f:= 0;
(* corection for centuries*)
if rok < 2500 then f:=3;
if rok < 2300 then f:=2;
if rok < 2200 then f:=1;
if rok < 2100 then f:=0;
if rok < 1900 then f:=6;
if rok < 1800 then f:=5;
if rok < 1700 then f:=4;
e:=(2*b+4*c+6*d +5+f) mod 7;
e:=22+d+e;
m:= 3;
if e > 31 then
begin
m:=4;
e:=e-31;
end;
if m=3 then
begin
Panel3.visible:=true;
Panel3.Caption:=InttoStr(e-2) + '.b°ezna.' + vstup;
Panel5.visible:=true;
Panel5.Caption:=InttoStr(e-1) + '.b°ezna.' + vstup;
Panel7.visible:=true;
Panel7.Caption:=InttoStr(e) + '.b°ezna.' + vstup;
end;
if m=4 then
begin
Panel3.visible:=true;
Panel3.Caption:=InttoStr(e-2) + '.dubna.' + vstup;
Panel5.visible:=true;
Panel5.Caption:=InttoStr(e-1) + '.dubna.' + vstup;
Panel7.visible:=true;
Panel7.Caption:=InttoStr(e) + '.dubna.' + vstup;
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
close;
end;
procedure TForm1.SpeedButton2Click(Sender: TObject);
var
vstup : string;
begin
vstup:=InputBox('Vstup roku','VypoΦtu den velikonoc','Zadej rok');
rok:= Strtoint(vstup);
a:= rok mod 19;
b:= rok mod 4;
c:= rok mod 7;
d:=(19*a+24) mod 30;
f:= 0;
(* corection for centuries*)
if rok < 2500 then f:=3;
if rok < 2300 then f:=2;
if rok < 2200 then f:=1;
if rok < 2100 then f:=0;
if rok < 1900 then f:=6;
if rok < 1800 then f:=5;
if rok < 1700 then f:=4;
e:=(2*b+4*c+6*d +5+f) mod 7;
e:=22+d+e;
m:= 3;
if e > 31 then
begin
m:=4;
e:=e-31;
end;
if m=3 then
begin
Panel3.visible:=true;
Panel3.Caption:=InttoStr(e-2) + '.b°ezna.' + vstup;
Panel5.visible:=true;
Panel5.Caption:=InttoStr(e-1) + '.b°ezna.' + vstup;
Panel7.visible:=true;
Panel7.Caption:=InttoStr(e) + '.b°ezna.' + vstup;
SndPlaySound('joy.wav',snd_Async);
end;
if m=4 then
begin
Panel3.visible:=true;
Panel3.Caption:=InttoStr(e-2) + '.dubna.' + vstup;
Panel5.visible:=true;
Panel5.Caption:=InttoStr(e-1) + '.dubna.' + vstup;
Panel7.visible:=true;
Panel7.Caption:=InttoStr(e) + '.dubna.' + vstup;
SndPlaySound('joy.wav',snd_Async);
end;
end;
procedure TForm1.SpeedButton1Click(Sender: TObject);
begin
close;
end;
end.