Доступ к архиву

Переход в группу "Пользователь"

300.00 ₽
Одноразовый платёж
Быстрый переход в группу "Пользователи", без надобности написания постов и ожидания.

Покупка дает возможность:
Быть полноправным участником форума
Нормальное копирование кода
Создавать темы
Скачивать файлы
Доступ к архиву Pawno-Info

[Delphi] Гороскоп

Статус
В этой теме нельзя размещать новые ответы.

hottabych1607

Умник
Код:
  TForm1 = class(TForm)
    CB2: TComboBox;
    MaskEdit1: TMaskEdit;
    Label1: TLabel;
    Label2: TLabel;
    CB1: TComboBox;
    Label3: TLabel;
    Label4: TLabel;
    Image1: TImage;
    Image2: TImage;

   
  




procedure TForm1.Button1Click(Sender: TObject);
  var
god,k:integer;//Объявляем переменные 

begin
 //if key=chr(13) then //Если нажал (13)- Enter то


 begin
if ((cb1.text>='21') and (cb2.text='Январь')) //Условие
or ((cb1.text<='18') and (cb2.text='Февраль'))
then
label1.caption:='Водолей';//Действие
 end;




 begin
   if ((cb1.text>='19') and (cb2.text='Февраль'))
   or ((cb1.text<='20') and (cb2.text='Март'))
then
label1.caption:='Рыба';
end;

begin
 if ((cb1.text>='21') and (cb2.text='Март'))
               or ((cb1.text<='20') and (cb2.text='Апрель'))

then
label1.caption:='Овен';
end;

begin
 if ((cb1.text>='21') and (cb2.text='Апрель'))
   or ((cb1.text<='21') and (cb2.text='Май'))
then
label1.caption:='Телец';
end;

begin
 if ((cb1.text>='22') and (cb2.text='Май'))
   or ((cb1.text<='21') and (cb2.text='Июнь'))
then
label1.caption:='Близнецы';
end;

begin
 if ((cb1.text>='22') and (cb2.text='Июнь'))

   or ((cb1.text<='22') and (cb2.text='Июль'))
then
label1.caption:='Рак';

end;
begin
 if ((cb1.text>='23') and (cb2.text='Июль'))
   or ((cb1.text<='23') and (cb2.text='Август'))
then
label1.caption:='Лев';

end;
begin
 if ((cb1.text>='24') and (cb2.text='Август'))
   or ((cb1.text<='23') and (cb2.text='Сентябрь'))
then
label1.caption:='Дева';

end;
begin
 if ((cb1.text>='24') and (cb2.text='Сентябрь'))
   or ((cb1.text<='23') and (cb2.text='Октябрь'))
then
label1.caption:='Весы';

end;
begin
 if ((cb1.text>='24') and (cb2.text='Октябрь'))
   or ((cb1.text<='22') and (cb2.text='Ноябрь'))
then
label1.caption:='Скорпион';

end;
begin
 if ((cb1.text>='23') and (cb2.text='Ноябрь'))
   or ((cb1.text<='21') and (cb2.text='Декабрь'))
then
label1.caption:='Стрелец';

end;
begin
 if ((cb1.text>='22') and (cb2.text='Декабрь'))
   or ((cb1.text<='20') and (cb2.text='Январь'))
then
label1.caption:='Козерог';

end;





     god:=StrToInt(Trim(maskEdit1.text)); //переводим строку, введенную в maskEdit1без обрамляющих пробелов, в целочисленный тип
k:=god mod 12;// делим год на 12 и в зависимости от остатка определяем: 0-обезьяна, 1-петух, 2-собака, 3-кабан, 4-крыса, 5-бык, 6-тигр, 7-кот, 8-дракон,9-змея, 10-лошадь,11-овца
case k of
0: Begin
label2.caption:='Обезьяны';
   end;
1: Begin
label2.caption:='Петуха';
   end;
   2: Begin
label2.caption:='Собаки';
   end;
   3: Begin
label2.caption:='Кобана';
   end;
   4: Begin
label2.caption:='Крысы';
   end;
   5: Begin
label2.caption:='Быка';
   end;
   6: Begin
label2.caption:='Тигра';
   end;
   7: Begin
label2.caption:='Кота';
   end;
   8: Begin
label2.caption:='Дракона';
   end;
   9: Begin
label2.caption:='Змеи';
   end;
   10: Begin
label2.caption:='Лошади';
   end;
   11: Begin
label2.caption:='Овцы';
   end;





 end;

    end;



procedure TForm1.Image2MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
Image2.Width:=155;
Image2.Height:=67;
end;

procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
Image2.Width:=145;
Image2.Height:=57;
end;

procedure TForm1.Image2Click(Sender: TObject);
 var
god,k:integer;

begin
 //if key=chr(13) then


 begin
if ((cb1.text>='21') and (cb2.text='Январь'))
or ((cb1.text<='18') and (cb2.text='Февраль'))
then
label1.caption:='Водолей';
 end;




 begin
   if ((cb1.text>='19') and (cb2.text='Февраль'))
   or ((cb1.text<='20') and (cb2.text='Март'))
then
label1.caption:='Рыба';
end;

begin
 if ((cb1.text>='21') and (cb2.text='Март'))
               or ((cb1.text<='20') and (cb2.text='Апрель'))

then
label1.caption:='Овен';
end;

begin
 if ((cb1.text>='21') and (cb2.text='Апрель'))
   or ((cb1.text<='21') and (cb2.text='Май'))
then
label1.caption:='Телец';
end;

begin
 if ((cb1.text>='22') and (cb2.text='Май'))
   or ((cb1.text<='21') and (cb2.text='Июнь'))
then
label1.caption:='Близнецы';
end;

begin
 if ((cb1.text>='22') and (cb2.text='Июнь'))

   or ((cb1.text<='22') and (cb2.text='Июль'))
then
label1.caption:='Рак';

end;
begin
 if ((cb1.text>='23') and (cb2.text='Июль'))
   or ((cb1.text<='23') and (cb2.text='Август'))
then
label1.caption:='Лев';

end;
begin
 if ((cb1.text>='24') and (cb2.text='Август'))
   or ((cb1.text<='23') and (cb2.text='Сентябрь'))
then
label1.caption:='Дева';

end;
begin
 if ((cb1.text>='24') and (cb2.text='Сентябрь'))
   or ((cb1.text<='23') and (cb2.text='Октябрь'))
then
label1.caption:='Весы';

end;
begin
 if ((cb1.text>='24') and (cb2.text='Октябрь'))
   or ((cb1.text<='22') and (cb2.text='Ноябрь'))
then
label1.caption:='Скорпион';

end;
begin
 if ((cb1.text>='23') and (cb2.text='Ноябрь'))
   or ((cb1.text<='21') and (cb2.text='Декабрь'))
then
label1.caption:='Стрелец';

end;
begin
 if ((cb1.text>='22') and (cb2.text='Декабрь'))
   or ((cb1.text<='20') and (cb2.text='Январь'))
then
label1.caption:='Козерог';

end;





     god:=StrToInt(Trim(maskEdit1.text)); //переводим строку, введенную в maskEdit1 без обрамляющих пробелов, в целочисленный тип
k:=god mod 12;// делим год на 12 и в зависимости от остатка определяем: 0-обезьяна, 1-петух, 2-собака, 3-кабан, 4-крыса, 5-бык, 6-тигр, 7-кот, 8-дракон,9-змея, 10-лошадь,11-овца
case k of
0: Begin
label2.caption:='Обезьяны';
   end;
1: Begin
label2.caption:='Петуха';
   end;
   2: Begin
label2.caption:='Собаки';
   end;
   3: Begin
label2.caption:='Кобана';
   end;
   4: Begin
label2.caption:='Крысы';
   end;
   5: Begin
label2.caption:='Быка';
   end;
   6: Begin
label2.caption:='Тигра';
   end;
   7: Begin
label2.caption:='Кота';
   end;
   8: Begin
label2.caption:='Дракона';
   end;
   9: Begin
label2.caption:='Змеи';
   end;
   10: Begin
label2.caption:='Лошади';
   end;
   11: Begin
label2.caption:='Овцы';
   end;





 end;

    end;


procedure TForm1.Image1MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
Image2.Width:=145;
Image2.Height:=57;
end;

end.
Вот и все! Тут просто надо смысл понять!
 
Статус
В этой теме нельзя размещать новые ответы.
Сверху Снизу