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; //уровень
  nim: integer=1;  // номер картинки
  w: integer=0; /// количество побед
implementation

{$R *.dfm}



procedure TForm1.Button1Click(Sender: TObject);
begin
  If lvl=4 then lvl:=1;
  Memo4.Lines.Strings[1]:=(IntToStr(lvl)+'-3');
  Memo7.Lines.Strings[1]:=(IntToStr(w)+'из 3');
  If lvl=1 then
    begin
      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');
    end
       else If lvl=2 then
            begin
              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');
               end
                  else begin
                         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');
                         end;
  If nim=10 then nim:=1;
Image1.Picture.LoadFromFile('Image'+IntToStr(nim)+'.bmp');
  inc(nim);
Image2.Picture.LoadFromFile('Image'+IntToStr(nim)+'.bmp');
  inc(nim);
Image3.Picture.LoadFromFile('Image'+IntToStr(nim)+'.bmp');
  inc(nim);

end;

procedure TForm1.Choose1Click(Sender: TObject);
begin
   If ((lvl=1) or (lvl=2)) then
      begin
      ShowMessage('Правильно');
      inc(lvl);
      inc(w);
      end
            else ShowMessage('Вы ошиблись');
   
end;



procedure TForm1.Choose2Click(Sender: TObject);
begin
   ShowMessage('Вы ошиблись');
   inc(lvl);
end;

procedure TForm1.Choose3Click(Sender: TObject);
begin
    If lvl=3 then
       begin
         ShowMessage('Правильно');
         inc(lvl);
         inc(w);
       end
             else ShowMessage('Вы ошиблись');
end;

end.
