unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ExtCtrls;

type
  TForm1 = class(TForm)
    Image1: TImage;
    Image2: TImage;
    Image3: TImage;
    Memo1: TMemo;
    Memo2: TMemo;
    Memo3: TMemo;
    Button1: TButton;
    Choose1: TButton;
    Choose2: TButton;
    Choose3: TButton;
    Memo4: TMemo;
    Memo5: TMemo;
    Memo6: TMemo;
    Memo7: TMemo;
    procedure Choose1Click(Sender: TObject);
    procedure Choose2Click(Sender: TObject);
    procedure Choose3Click(Sender: TObject);
    procedure Button1Click(Sender: TObject);

  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  lvl:integer=1; //уровень
  w: integer=0; /// количество побед
implementation

{$R *.dfm}



procedure TForm1.Button1Click(Sender: TObject);
begin
  Memo4.Lines.Strings[1]:=(IntToStr(lvl)+'-3');
  Memo7.Lines.Strings[1]:=(IntToStr(w)+'-3');
  Memo5.Lines.LoadFromFile('Data/Level1/situ.txt');
  Memo1.Lines.LoadFromFile('Data/Level1/ch1.txt');
  Memo2.Lines.LoadFromFile('Data/Level1/ch2.txt');
  Memo3.Lines.LoadFromFile('Data/Level1/ch3.txt');
  Image1.Picture.LoadFromFile('Image1.bmp');
  Image2.Picture.LoadFromFile('Image2.bmp');
  Image3.Picture.LoadFromFile('Image3.bmp');

end;

procedure TForm1.Choose1Click(Sender: TObject);
begin
  If lvl<=3 then
                begin
                  inc(lvl);
                  inc(w);
                end;
  If lvl=4 then
                begin
                    ShowMessage('Итак, количество правильно выбранных подозреваемых...');
                    ShowMessage(IntToStr(w)+'!');
                    lvl:=1;
                    w:=0;
                    Memo5.Lines.LoadFromFile('Data/Level1/situ.txt');
                    Memo1.Lines.LoadFromFile('Data/Level1/ch1.txt');
                    Memo2.Lines.LoadFromFile('Data/Level1/ch2.txt');
                    Memo3.Lines.LoadFromFile('Data/Level1/ch3.txt');
                    Image1.Picture.LoadFromFile('Image1.bmp');
                    Image2.Picture.LoadFromFile('Image2.bmp');
                    Image3.Picture.LoadFromFile('Image3.bmp');
                end;
      
      If lvl=2 then
                   begin
                    Memo4.Lines.Strings[1]:=(IntToStr(lvl)+'-3');
                    Memo7.Lines.Strings[1]:=(IntToStr(w)+'-3');
                    Memo5.Lines.LoadFromFile('Data/Level2/situ.txt');
                    Memo1.Lines.LoadFromFile('Data/Level2/ch1.txt');
                    Memo2.Lines.LoadFromFile('Data/Level2/ch2.txt');
                    Memo3.Lines.LoadFromFile('Data/Level2/ch3.txt');
                    Image1.Picture.LoadFromFile('Image4.bmp');
                    Image2.Picture.LoadFromFile('Image5.bmp');
                    Image3.Picture.LoadFromFile('Image6.bmp');
                   end
               else  If lvl=3 then 
                                  begin
                                    Memo4.Lines.Strings[1]:=(IntToStr(lvl)+'-3');
                                    Memo7.Lines.Strings[1]:=(IntToStr(w)+'-3');
                                    Memo5.Lines.LoadFromFile('Data/Level3/situ.txt');
                                    Memo1.Lines.LoadFromFile('Data/Level3/ch1.txt');
                                    Memo2.Lines.LoadFromFile('Data/Level3/ch2.txt');
                                    Memo3.Lines.LoadFromFile('Data/Level3/ch3.txt');
                                    Image1.Picture.LoadFromFile('Image7.bmp');
                                    Image2.Picture.LoadFromFile('Image8.bmp');
                                    Image3.Picture.LoadFromFile('Image9.bmp');
                                    end;
end;



procedure TForm1.Choose2Click(Sender: TObject);
begin
  If lvl<=3 then  inc(lvl);
  If lvl=4 then
                begin
                    ShowMessage('Итак, количество правильно выбранных подозреваемых...');
                    ShowMessage(IntToStr(w)+'!');
                    lvl:=1;
                    w:=0;
                    Memo5.Lines.LoadFromFile('Data/Level1/situ.txt');
                    Memo1.Lines.LoadFromFile('Data/Level1/ch1.txt');
                    Memo2.Lines.LoadFromFile('Data/Level1/ch2.txt');
                    Memo3.Lines.LoadFromFile('Data/Level1/ch3.txt');
                    Image1.Picture.LoadFromFile('Image1.bmp');
                    Image2.Picture.LoadFromFile('Image2.bmp');
                    Image3.Picture.LoadFromFile('Image3.bmp');
                end;
    If lvl=2    then
            begin
              Memo4.Lines.Strings[1]:=(IntToStr(lvl)+'-3');
              Memo7.Lines.Strings[1]:=(IntToStr(w)+'-3');
              Memo5.Lines.LoadFromFile('Data/Level2/situ.txt');
              Memo1.Lines.LoadFromFile('Data/Level2/ch1.txt');
              Memo2.Lines.LoadFromFile('Data/Level2/ch2.txt');
              Memo3.Lines.LoadFromFile('Data/Level2/ch3.txt');
              Image1.Picture.LoadFromFile('Image4.bmp');
              Image2.Picture.LoadFromFile('Image5.bmp');
              Image3.Picture.LoadFromFile('Image6.bmp');
            end
                else      begin
                         Memo4.Lines.Strings[1]:=(IntToStr(lvl)+'-3');
                         Memo7.Lines.Strings[1]:=(IntToStr(w)+'-3');
                         Memo5.Lines.LoadFromFile('Data/Level3/situ.txt');
                         Memo1.Lines.LoadFromFile('Data/Level3/ch1.txt');
                         Memo2.Lines.LoadFromFile('Data/Level3/ch2.txt');
                         Memo3.Lines.LoadFromFile('Data/Level3/ch3.txt');
                         Image1.Picture.LoadFromFile('Image7.bmp');
                         Image2.Picture.LoadFromFile('Image8.bmp');
                         Image3.Picture.LoadFromFile('Image9.bmp');
                         end;
      

end;

procedure TForm1.Choose3Click(Sender: TObject);
begin
  If lvl<=3 then  inc(lvl);
  If lvl=4 then
                begin
                    Inc(w);
                    ShowMessage('Итак, количество правильно выбранных подозреваемых...');
                    ShowMessage(IntToStr(w)+'!');
                    lvl:=1;
                    w:=0;
                    Memo5.Lines.LoadFromFile('Data/Level1/situ.txt');
                    Memo1.Lines.LoadFromFile('Data/Level1/ch1.txt');
                    Memo2.Lines.LoadFromFile('Data/Level1/ch2.txt');
                    Memo3.Lines.LoadFromFile('Data/Level1/ch3.txt');
                    Image1.Picture.LoadFromFile('Image1.bmp');
                    Image2.Picture.LoadFromFile('Image2.bmp');
                    Image3.Picture.LoadFromFile('Image3.bmp');
                end;
   If lvl=2 then
            begin
              Memo4.Lines.Strings[1]:=(IntToStr(lvl)+'-3');
              Memo7.Lines.Strings[1]:=(IntToStr(w)+'-3');
              Memo5.Lines.LoadFromFile('Data/Level2/situ.txt');
              Memo1.Lines.LoadFromFile('Data/Level2/ch1.txt');
              Memo2.Lines.LoadFromFile('Data/Level2/ch2.txt');
              Memo3.Lines.LoadFromFile('Data/Level2/ch3.txt');
              Image1.Picture.LoadFromFile('Image4.bmp');
              Image2.Picture.LoadFromFile('Image5.bmp');
              Image3.Picture.LoadFromFile('Image6.bmp');

            end
               else If lvl=3 then
                                 begin
                                   Memo4.Lines.Strings[1]:=(IntToStr(lvl)+'-3');
                                   Memo7.Lines.Strings[1]:=(IntToStr(w)+'-3');
                                   Memo5.Lines.LoadFromFile('Data/Level3/situ.txt');
                                   Memo1.Lines.LoadFromFile('Data/Level3/ch1.txt');
                                   Memo2.Lines.LoadFromFile('Data/Level3/ch2.txt');
                                   Memo3.Lines.LoadFromFile('Data/Level3/ch3.txt');
                                   Image1.Picture.LoadFromFile('Image7.bmp');
                                   Image2.Picture.LoadFromFile('Image8.bmp');
                                   Image3.Picture.LoadFromFile('Image9.bmp');

                                 end;
end;

end.
