Здравствуйте. Я пишу программу на языке Pascal. Подскажите пожалуйста, как мне записать в блок-схему мои 18 if-ов?
Я пишу программу на языке Pascal. Подскажите пожалуйста, как мне записать в блок-схему мои 18 if-ов?
Вот листинг процедуры:
procedure TForm1.Prov(Sender: TObject);
begin
if (((Button1.Caption='x') and (Button2.Caption='x')) and (Button3.Caption='x')) then Label1.Caption:='Выиграли крестики';
if (((Button4.Caption='x') and (Button5.Caption='x')) and (Button6.Caption='x')) then Label1.Caption:='Выиграли крестики';
if (((Button7.Caption='x') and (Button8.Caption='x')) and (Button9.Caption='x')) then Label1.Caption:='Выиграли крестики';
if (((Button1.Caption='x') and (Button4.Caption='x')) and (Button7.Caption='x')) then Label1.Caption:='Выиграли крестики';
if (((Button2.Caption='x') and (Button5.Caption='x')) and (Button8.Caption='x')) then Label1.Caption:='Выиграли крестики';
if (((Button3.Caption='x') and (Button6.Caption='x')) and (Button9.Caption='x')) then Label1.Caption:='Выиграли крестики';
if (((Button1.Caption='x') and (Button5.Caption='x')) and (Button9.Caption='x')) then Label1.Caption:='Выиграли крестики';
if (((Button3.Caption='x') and (Button5.Caption='x')) and (Button7.Caption='x')) then Label1.Caption:='Выиграли крестики';
if (((Button1.Caption='о') and (Button2.Caption='о')) and (Button3.Caption='о')) then Label1.Caption:='Выиграли нолики';
if (((Button4.Caption='о') and (Button5.Caption='о')) and (Button6.Caption='о')) then Label1.Caption:='Выиграли нолики';
if (((Button7.Caption='о') and (Button8.Caption='о')) and (Button9.Caption='о')) then Label1.Caption:='Выиграли нолики';
if (((Button1.Caption='о') and (Button4.Caption='о')) and (Button7.Caption='о')) then Label1.Caption:='Выиграли нолики';
if (((Button2.Caption='о') and (Button5.Caption='о')) and (Button8.Caption='о')) then Label1.Caption:='Выиграли нолики';
if (((Button3.Caption='о') and (Button6.Caption='о')) and (Button9.Caption='о')) then Label1.Caption:='Выиграли нолики';
if (((Button1.Caption='о') and (Button5.Caption='о')) and (Button9.Caption='о')) then Label1.Caption:='Выиграли нолики';
if (((Button3.Caption='о') and (Button5.Caption='о')) and (Button7.Caption='о')) then Label1.Caption:='Выиграли нолики';
if Label1.Caption='Выиграли крестики' then OffButton(Sender);
if Label1.Caption='Выиграли нолики' then OffButton(Sender);
end;