unit P_mem;

interface

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

type
  TForm1 = class(TForm)
    Image1: TImage;
    MainMenu1: TMainMenu;
    Start1: TMenuItem;
    Exit1: TMenuItem;
    Zelfplaatjeskiezen1: TMenuItem;
    Metdoordepcgekozenplaatjesspelen1: TMenuItem;
    OpenPictureDialog1: TOpenPictureDialog;
    Shape1: TShape;
    OpenPictureDialog2: TOpenPictureDialog;
    OpenPictureDialog3: TOpenPictureDialog;
    OpenPictureDialog4: TOpenPictureDialog;
    Label2: TLabel;
    Image2: TImage;
    Image3: TImage;
    Image4: TImage;
    Image5: TImage;
    Image6: TImage;
    Image7: TImage;
    Image8: TImage;
    Shape2: TShape;
    Shape3: TShape;
    Shape4: TShape;
    Shape5: TShape;
    Shape6: TShape;
    Shape7: TShape;
    Shape8: TShape;
    Timer1: TTimer;
    label1: TLabel;
    Speluitleg1: TMenuItem;
    Image10: TImage;
    Image11: TImage;
    Image12: TImage;
    Image13: TImage;
    Image14: TImage;
    Image15: TImage;
    Image16: TImage;
    Image17: TImage;
    Image19: TImage;
    Image20: TImage;
    Image21: TImage;
    Image22: TImage;
    Image23: TImage;
    Image24: TImage;
    Image25: TImage;
    Image26: TImage;
    Image27: TImage;
    Image28: TImage;
    Image29: TImage;
    Image30: TImage;
    Image31: TImage;
    Image32: TImage;
    Image33: TImage;
    Image34: TImage;
    Image9: TImage;
    Image18: TImage;
    Shape9: TShape;
    Shape10: TShape;
    Shape11: TShape;
    Shape12: TShape;
    Shape13: TShape;
    Shape14: TShape;
    Shape15: TShape;
    Shape16: TShape;
    Shape17: TShape;
    Shape18: TShape;
    Shape19: TShape;
    Shape20: TShape;
    Shape21: TShape;
    Shape22: TShape;
    Shape23: TShape;
    Shape24: TShape;
    Shape25: TShape;
    Shape26: TShape;
    Shape27: TShape;
    Shape28: TShape;
    Shape29: TShape;
    Shape30: TShape;
    Shape31: TShape;
    Shape32: TShape;
    Shape33: TShape;
    Shape34: TShape;
    Shape35: TShape;
    Shape36: TShape;
    Shape37: TShape;
    Shape38: TShape;
    Shape39: TShape;
    Shape40: TShape;
    Shape41: TShape;
    Shape42: TShape;
    Shape43: TShape;
    Shape44: TShape;
    Shape45: TShape;
    Shape46: TShape;
    Shape47: TShape;
    Shape48: TShape;
    Shape49: TShape;
    Shape50: TShape;
    Shape51: TShape;
    Shape52: TShape;
    Shape53: TShape;
    Shape54: TShape;
    Shape55: TShape;
    Shape56: TShape;
    Shape57: TShape;
    Shape58: TShape;
    Shape59: TShape;
    Shape60: TShape;
    Shape61: TShape;
    Shape62: TShape;
    Shape63: TShape;
    Shape64: TShape;
    Shape65: TShape;
    Shape66: TShape;
    Shape67: TShape;
    Shape68: TShape;
    Shape69: TShape;
    Label4: TLabel;
    Image35: TImage;
    Label3: TLabel;
    OpenPictureDialog5: TOpenPictureDialog;
    OpenPictureDialog6: TOpenPictureDialog;
    OpenPictureDialog7: TOpenPictureDialog;
    OpenPictureDialog8: TOpenPictureDialog;
    OpenPictureDialog9: TOpenPictureDialog;
    OpenPictureDialog10: TOpenPictureDialog;
    OpenPictureDialog11: TOpenPictureDialog;
    OpenPictureDialog12: TOpenPictureDialog;
    OpenPictureDialog13: TOpenPictureDialog;
    OpenPictureDialog14: TOpenPictureDialog;
    OpenPictureDialog15: TOpenPictureDialog;
    OpenPictureDialog16: TOpenPictureDialog;
    OpenPictureDialog17: TOpenPictureDialog;
    procedure Exit1Click(Sender: TObject);
    procedure Metdoordepcgekozenplaatjesspelen1Click(Sender: TObject);
    procedure Zelfplaatjeskiezen1Click(Sender: TObject);
    procedure Shape1MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure FormCreate(Sender: TObject);
    procedure Shape4MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure Shape2MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure Shape3MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure Shape5MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure Shape6MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure Shape7MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure Shape8MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure Timer1Timer(Sender: TObject);
    procedure Shape17MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure Speluitleg1Click(Sender: TObject);
    procedure Shape9MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure Shape32MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure Shape10MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure Shape24MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure Shape11MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure Shape18MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure Shape12MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure Shape27MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure Shape13MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure Shape30MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure Shape14MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure Shape16MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure Shape15MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure Shape22MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure Shape34MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure Shape19MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure Shape26MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure Shape20MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure Shape29MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure Shape21MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure Shape33MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure Shape23MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure Shape31MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure Shape25MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure Shape28MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure Shape69MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

var
  omgedraaiden: array[1..34] of boolean;
  plaatjes: array [1..17] of string;
  eentjeomgedraaid: boolean;// wordt true al er één shape is omgedraaid
  tijd1:  integer;

//begint als je twee dezelfde hebt
procedure memory();
begin
  showmessage('goedzo je hebt er een!');
end;

//maakt alle shapes zichtbaar
procedure terugdraaien();
  begin
  form1.shape1.visible:=true;
  form1.shape2.visible:=true;
  form1.shape3.visible:=true;
  form1.shape4.visible:=true;
  form1.shape5.visible:=true;
  form1.shape6.visible:=true;
  form1.Shape7.visible:=true;
  form1.shape8.visible:=true;
  form1.Shape9.visible:=true;
  form1.shape10.visible:=true;
  form1.shape11.visible:=true;
  form1.shape12.visible:=true;
  form1.shape13.visible:=true;
  form1.shape14.visible:=true;
  form1.shape15.visible:=true;
  form1.shape16.visible:=true;
  form1.Shape17.visible:=true;
  form1.shape18.visible:=true;
  form1.Shape19.visible:=true;
  form1.shape20.visible:=true;
  form1.shape21.visible:=true;
  form1.shape22.visible:=true;
  form1.shape23.visible:=true;
  form1.shape24.visible:=true;
  form1.shape25.visible:=true;
  form1.shape26.visible:=true;
  form1.Shape27.visible:=true;
  form1.shape28.visible:=true;
  form1.Shape29.visible:=true;
  form1.shape30.visible:=true;
  form1.shape31.visible:=true;
  form1.shape32.visible:=true;
  form1.shape33.visible:=true;
  form1.shape34.visible:=true;
  //form1.shape69.visible:=false;
end;

//zet alle omgedraaid op false
procedure omgedraaid();
var
  teller2: integer;
begin
  for teller2:= 1 to 34 do
  begin
    omgedraaiden[teller2]:=false;
  end;
end;

procedure shapes();
begin
  form1.shape35.visible:=false;
  form1.shape36.visible:=false;
  form1.Shape37.visible:=false;
  form1.shape38.visible:=false;
  form1.Shape39.visible:=false;
  form1.Shape40.visible:=false;
  form1.shape41.visible:=false;
  form1.shape42.visible:=false;
  form1.shape43.visible:=false;
  form1.shape44.visible:=false;
  form1.shape45.visible:=false;
  form1.shape46.visible:=false;
  form1.Shape47.visible:=false;
  form1.shape48.visible:=false;
  form1.Shape49.visible:=false;
  form1.shape50.visible:=false;
  form1.shape51.visible:=false;
  form1.shape52.visible:=false;
  form1.shape53.visible:=false;
  form1.shape54.visible:=false;
  form1.shape55.visible:=false;
  form1.shape56.visible:=false;
  form1.Shape57.visible:=false;
  form1.shape58.visible:=false;
  form1.Shape59.visible:=false;
  form1.shape60.visible:=false;
  form1.shape61.visible:=false;
  form1.shape62.visible:=false;
  form1.shape63.visible:=false;
  form1.shape64.visible:=false;
  form1.shape65.visible:=false;
  form1.shape66.visible:=false;
  form1.Shape67.visible:=false;
  form1.shape68.visible:=false;
end;

procedure omdraaien2();
var
teller4: integer;
begin
  for teller4 := 1 to 34 do
    begin
      omgedraaiden[teller4]:=false
    end;
end;

procedure Iksor(var Iksor2:boolean);//controleert of er maar een is omgedraaid
begin
  If
  form1.shape1.visible=false XOR
  form1.shape2.visible=false XOR
  form1.shape3.visible=false XOR
  form1.shape4.visible=false XOR
  form1.shape5.visible=false XOR
  form1.shape6.visible=false XOR
  form1.shape7.visible=false XOR
  form1.shape8.visible=false XOR
  form1.shape9.visible=false XOR
  form1.shape10.visible=false XOR
  form1.shape11.visible=false XOR
  form1.shape12.visible=false XOR
  form1.shape13.visible=false XOR
  form1.shape14.visible=false XOR
  form1.shape15.visible=false XOR
  form1.shape16.visible=false XOR
  form1.shape17.visible=false XOR
  form1.shape18.visible=false XOR
  form1.shape19.visible=false XOR
  form1.shape20.visible=false XOR
  form1.shape21.visible=false XOR
  form1.shape22.visible=false XOR
  form1.shape23.visible=false XOR
  form1.shape24.visible=false XOR
  form1.shape25.visible=false XOR
  form1.shape26.visible=false XOR
  form1.shape27.visible=false XOR
  form1.shape28.visible=false XOR
  form1.shape29.visible=false XOR
  form1.shape30.visible=false XOR
  form1.shape31.visible=false XOR
  form1.shape32.visible=false XOR
  form1.shape33.visible=false XOR
  form1.shape34.visible=false then
  begin
    Iksor2:=true;
  end
  else
  begin
    Iksor2:=false;
  end;
end;

// als je op exit klikt
procedure TForm1.Exit1Click(Sender: TObject);
  begin
    if MessageDlg('Weet je zeker dat je wilt stoppen?',
    mtConfirmation, [mbyes, mbno], 0)= mrYes then
      begin
        application.Terminate;
      end;
  end;

// zorgt ervoor dat de pc de plaatjes neerzet
procedure TForm1.Metdoordepcgekozenplaatjesspelen1Click(Sender: TObject);
var
  teller3: integer;
  plaatjesbestand:  TextFile;
  begin
    AssignFile(plaatjesbestand, '..\plaatjes.txt');
    Reset(plaatjesbestand);
    for teller3:= 1 to 17 do
    begin
      Readln(plaatjesbestand, plaatjes[teller3]);
    end;
    begin
        Image1.Picture.LoadFromFile(plaatjes[1]);
        Image2.Picture.LoadFromFile(plaatjes[2]);
        Image3.Picture.LoadFromFile(plaatjes[3]);
        Image4.Picture.LoadFromFile(plaatjes[1]);
        Image5.Picture.LoadFromFile(plaatjes[4]);
        Image6.Picture.LoadFromFile(plaatjes[4]);
        Image7.Picture.LoadFromFile(plaatjes[2]);
        Image8.Picture.LoadFromFile(plaatjes[3]);
        Image9.Picture.LoadFromFile(plaatjes[5]);
        Image10.Picture.LoadFromFile(plaatjes[6]);
        Image11.Picture.LoadFromFile(plaatjes[7]);
        Image12.Picture.LoadFromFile(plaatjes[8]);
        Image13.Picture.LoadFromFile(plaatjes[9]);
        Image14.Picture.LoadFromFile(plaatjes[10]);
        Image15.Picture.LoadFromFile(plaatjes[11]);
        Image16.Picture.LoadFromFile(plaatjes[10]);
        Image17.Picture.LoadFromFile(plaatjes[12]);
        Image18.Picture.LoadFromFile(plaatjes[7]);
        Image19.Picture.LoadFromFile(plaatjes[17]);
        Image20.Picture.LoadFromFile(plaatjes[13]);
        Image21.Picture.LoadFromFile(plaatjes[14]);
        Image22.Picture.LoadFromFile(plaatjes[11]);
        Image23.Picture.LoadFromFile(plaatjes[15]);
        Image24.Picture.LoadFromFile(plaatjes[6]);
        Image25.Picture.LoadFromFile(plaatjes[16]);
        Image26.Picture.LoadFromFile(plaatjes[17]);
        Image27.Picture.LoadFromFile(plaatjes[8]);
        Image28.Picture.LoadFromFile(plaatjes[16]);
        Image29.Picture.LoadFromFile(plaatjes[13]);
        Image30.Picture.LoadFromFile(plaatjes[9]);
        Image31.Picture.LoadFromFile(plaatjes[15]);
        Image32.Picture.LoadFromFile(plaatjes[5]);
        Image33.Picture.LoadFromFile(plaatjes[14]);
        Image34.Picture.LoadFromFile(plaatjes[12]);
        tijd1:= 120;
        timer1.Enabled:=true;
        terugdraaien();
        shapes();
        omdraaien2();
       end;
    end;

//laat je zelf 17 plaatjes kiezen om mee te spelen
procedure TForm1.Zelfplaatjeskiezen1Click(Sender: TObject);
begin
if MessageDlg('Kies zometeen 17 plaatjes uit waarmee je het spel wil spelen. ' +
              'Let op dat je niet dezelfde plaatjes uitkiest! Weet je zeker dat je wil doorgaan?',
    mtConfirmation, [mbyes, mbno], 0)= mrYes then
  begin
    if OpenPictureDialog1.execute then
    begin
      Image1.Picture.loadfromfile(Openpicturedialog1.filename);
      Image4.Picture.loadfromfile(Openpicturedialog1.filename);
    end;
    if OpenPictureDialog2.execute then
    begin
      Image2.Picture.loadfromfile(Openpicturedialog2.filename);
      Image7.Picture.loadfromfile(Openpicturedialog2.filename);
    end;
    if OpenPictureDialog3.execute then
    begin
      Image3.Picture.loadfromfile(Openpicturedialog3.filename);
      Image8.Picture.loadfromfile(Openpicturedialog3.filename);
    end;
    if OpenPictureDialog4.execute then
    begin
      Image5.Picture.loadfromfile(Openpicturedialog4.filename);
      Image6.Picture.loadfromfile(Openpicturedialog4.filename);
    end;
    if OpenPictureDialog5.execute then
    begin
      Image9.Picture.loadfromfile(Openpicturedialog5.filename);
      Image32.Picture.loadfromfile(Openpicturedialog5.filename);
    end;
       if OpenPictureDialog6.execute then
    begin
      Image10.Picture.loadfromfile(Openpicturedialog6.filename);
      Image24.Picture.loadfromfile(Openpicturedialog6.filename);
    end;
    if OpenPictureDialog7.execute then
    begin
      Image11.Picture.loadfromfile(Openpicturedialog7.filename);
      Image18.Picture.loadfromfile(Openpicturedialog7.filename);
    end;
      if OpenPictureDialog8.execute then
    begin
      Image12.Picture.loadfromfile(Openpicturedialog8.filename);
      Image27.Picture.loadfromfile(Openpicturedialog8.filename);
    end;
    if OpenPictureDialog9.execute then
    begin
      Image13.Picture.loadfromfile(Openpicturedialog9.filename);
      Image30.Picture.loadfromfile(Openpicturedialog9.filename);
    end;
    if OpenPictureDialog10.execute then
    begin
      Image14.Picture.loadfromfile(Openpicturedialog10.filename);
      Image16.Picture.loadfromfile(Openpicturedialog10.filename);
    end;
    if OpenPictureDialog11.execute then
    begin
      Image15.Picture.loadfromfile(Openpicturedialog11.filename);
      Image22.Picture.loadfromfile(Openpicturedialog11.filename);
    end;
    if OpenPictureDialog12.execute then
    begin
      Image17.Picture.loadfromfile(Openpicturedialog12.filename);
      Image34.Picture.loadfromfile(Openpicturedialog12.filename);
    end;
    if OpenPictureDialog13.execute then
    begin
      Image19.Picture.loadfromfile(Openpicturedialog13.filename);
      Image26.Picture.loadfromfile(Openpicturedialog13.filename);
    end;
    if OpenPictureDialog14.execute then
    begin
      Image20.Picture.loadfromfile(Openpicturedialog14.filename);
      Image29.Picture.loadfromfile(Openpicturedialog14.filename);
    end;
    if OpenPictureDialog15.execute then
    begin
      Image21.Picture.loadfromfile(Openpicturedialog15.filename);
      Image33.Picture.loadfromfile(Openpicturedialog15.filename);
    end;
    if OpenPictureDialog16.execute then
    begin
      Image23.Picture.loadfromfile(Openpicturedialog16.filename);
      Image31.Picture.loadfromfile(Openpicturedialog16.filename);
    end;
    if OpenPictureDialog17.execute then
    begin
      Image25.Picture.loadfromfile(Openpicturedialog17.filename);
      Image28.Picture.loadfromfile(Openpicturedialog17.filename);
    end
    else Showmessage('File Problem');
    end;
  terugdraaien();
  shapes();
  omdraaien2();
  tijd1:= 120;
  timer1.Enabled:=true
end;


//begin programma
procedure TForm1.FormCreate(Sender: TObject);
var
  teller: integer;
begin
  for teller := 1 to 34 do
  begin
    omgedraaiden[teller]:=false
  end;
  Form1.Color := clOlive;
  eentjeomgedraaid:=false;
  shapes();
  showmessage('Klik op Start om plaatjes te (laten) kiezen, en het spel kan beginnen! Succes!');
end;

// als je op shape1 klikt
procedure TForm1.Shape1MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
var
  check1: boolean;
begin
  (Sender as Tshape).Visible:= false;
  omgedraaiden[1]:= true;
  If (omgedraaiden[1] = true) AND (omgedraaiden[4] = true) then
  begin
    memory();//roept procedure aan
    shape35.visible:=true;
    shape38.visible:=true;
    terugdraaien();
  end;
    Iksor(check1);
  if check1=true then
  begin
  end
  else
  begin
    shape69.visible := true;
  end;
end; 


// als je op shape2 klikt
procedure TForm1.Shape2MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
var
   check2: boolean;
begin
    (Sender as Tshape).Visible:= false;
    omgedraaiden[2]:= true;
    If (omgedraaiden[2] = true) AND (omgedraaiden[7] = true) then
    begin
      memory();//roept procedure aan
      shape36.visible:=true;
      shape41.visible:=true;
      terugdraaien();
    end;
    Iksor(check2);
  if check2=true then
  begin
  end
  else begin
    shape69.visible := true;
  end;
end;

// als je op shape3 klikt
procedure TForm1.Shape3MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
var
  check3: boolean;
begin
    (Sender as Tshape).Visible:= false;
     omgedraaiden[3]:= true;
    If (omgedraaiden[3] = true) AND (omgedraaiden[8] = true) then
    begin
      memory();//roept procedure aan
      shape37.visible:=true;
      shape42.visible:=true;
      terugdraaien();
    end;
    Iksor(check3);
  if check3=true then
  begin
  end
    else
    begin
      shape69.visible := true;
    end;
end;

// als je op shape4 klikt
procedure TForm1.Shape4MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
var
  check4: boolean;
begin
    (Sender as Tshape).Visible:= false;
    omgedraaiden[4]:= true;
    If (omgedraaiden[4] = true) AND (omgedraaiden[1] = true) then
    begin
      memory();//roept procedure aan
      shape38.visible:=true;
      shape35.visible:=true;
      terugdraaien();
    end;
    Iksor(check4);
    if check4=true then
    begin
    end
    else
    begin
      shape69.visible := true;
    end;
end;

// als je op shape5 klikt
procedure TForm1.Shape5MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
var
  check5:boolean;
begin
    (Sender as Tshape).Visible:= false;
     omgedraaiden[5]:= true;
    If (omgedraaiden[5] = true) AND (omgedraaiden[6] = true) then
    begin
      memory();//roept procedure aan
      shape39.visible:=true;
      shape40.visible:=true;
      terugdraaien();
    end;
    Iksor(check5);
    if check5=true then
    begin
    end
    else
    begin
      shape69.visible := true;
    end;
  end;

// als je op shape6 klikt
procedure TForm1.Shape6MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
var
  check6: boolean;
begin
    (Sender as Tshape).Visible:= false;
    omgedraaiden[6]:= true;
    If (omgedraaiden[6] = true) AND (omgedraaiden[5] = true) then
    begin
      memory();//roept procedure aan
      shape39.visible:=true;
      shape40.visible:=true;
      terugdraaien();
    end;
    Iksor(check6);
    if check6=true then
    begin
    end
    else
    begin
      shape69.visible := true;
    end;
end;

// als je op shape7 klikt
procedure TForm1.Shape7MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
var
  check7:boolean;
begin
  (Sender as Tshape).Visible:= false;
  omgedraaiden[7]:= true;
  If (omgedraaiden[7] = true) AND (omgedraaiden[2] = true) then
    begin
      memory();//roept procedure aan
      shape41.visible:=true;
      shape36.visible:=true;
      terugdraaien();
    end;
    Iksor(check7);
    if check7=true then
    begin
    end
    else
    begin
      shape69.visible := true;
    end;
end;

// als je op shape8 klikt
procedure TForm1.Shape8MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
var
  check8: boolean;
begin
   (Sender as Tshape).Visible:= false;
    omgedraaiden[8]:= true;
    If (omgedraaiden[8] = true) AND (omgedraaiden[3] = true) then
    begin
      memory();//roept procedure aan
      shape42.visible:=true;
      shape37.visible:=true;
      terugdraaien();
    end;
    Iksor(check8);
    if check8=true then
    begin
    end
    else
    begin
      shape69.visible := true;
    end;
end;


procedure TForm1.Timer1Timer(Sender: TObject);
begin
  tijd1:= tijd1 - 1;
  label1.Caption := IntToStr(tijd1);
  if tijd1=0 then timer1.Enabled:= false;
  if tijd1=0 then showmessage('Helaas, de tijd is om');
  if
  (shape35.visible=true)  AND
  (shape36.visible=true)  AND
  (Shape37.visible=true)  AND
  (shape38.visible=true)  AND
  (Shape39.visible=true)  AND
  (Shape40.visible=true)  AND
  (shape41.visible=true)  AND
  (shape42.visible=true)  AND
  (shape43.visible=true)  AND
  (shape44.visible=true)  AND
  (shape45.visible=true)  AND
  (shape46.visible=true)  AND
  (Shape47.visible=true)  AND
  (shape48.visible=true)  AND
  (Shape49.visible=true)  AND
  (shape50.visible=true)  AND
  (shape51.visible=true)  AND
  (shape52.visible=true)  AND
  (shape53.visible=true)  AND
  (shape54.visible=true)  AND
  (shape55.visible=true)  AND
  (shape56.visible=true)  AND
  (Shape57.visible=true)  AND
  (shape58.visible=true)  AND
  (Shape59.visible=true)  AND
  (shape60.visible=true)  AND
  (shape61.visible=true)  AND
  (shape62.visible=true)  AND
  (shape63.visible=true)  AND
  (shape64.visible=true)  AND
  (shape65.visible=true)  AND
  (shape66.visible=true)  AND
  (Shape67.visible=true)  AND
  (shape68.visible=true)  Then
  begin
      timer1.Enabled:=false;
      showmessage('Gefeliciteerd, je hebt gewonnen!' +
      'Je hebt er ' + InttoStr(120-tijd1) + ' seconden over gedaan.');
    end;
end;

procedure TForm1.Shape17MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);

var
  check17: boolean;
begin
  (Sender as Tshape).Visible:= false;
  omgedraaiden[17]:= true;
  If (omgedraaiden[17] = true) AND (omgedraaiden[34] = true) then
  begin
    memory();//roept procedure aan
    shape51.visible:=true;
    shape68.visible:=true;
    terugdraaien();
  end;
    Iksor(check17);
  if check17=true then
  begin
  end
  else
  begin
    shape69.visible := true;
  end;
end;


procedure TForm1.Speluitleg1Click(Sender: TObject);
begin
  showmessage('Het doel van het spel is om twee gelijke paren bij elkaar te zoeken. ' +
              'Dit doe je door op twee vakken te klikken. Zijn ze hetzelfde, dan verschijnt ' +
              'er een rood vlak op de twee plaatjes, ten teken dat je die al geraden hebt. ' +
              'Zijn ze niet hetzelfde, dan blijven ze openstaan totdat je nog een keer ergens op het speelveld klikt. '+
              'Zijn ze eenmaal teruggedraaid, dan kan je opnieuw twee plaatjes openklikken. Je hebt 60 seconden de tijd het spel te spelen, en die tijd '+
              'gaat lopen als je de plaatjes hebt gekozen. Succes!')
end;

procedure TForm1.Shape9MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
var
  check9: boolean;
begin
  (Sender as Tshape).Visible:= false;
  omgedraaiden[9]:= true;
  If (omgedraaiden[9] = true) AND (omgedraaiden[32] = true) then
  begin
    memory();//roept procedure aan
    shape43.visible:=true;
    shape66.visible:=true;
    terugdraaien();
  end;
    Iksor(check9);
  if check9=true then
  begin
  end
  else
  begin
    shape69.visible := true;
  end;
end;


procedure TForm1.Shape32MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);

var
  check32: boolean;
begin
  (Sender as Tshape).Visible:= false;
  omgedraaiden[32]:= true;
  If (omgedraaiden[32] = true) AND (omgedraaiden[9] = true) then
  begin
    memory();//roept procedure aan
    shape43.visible:=true;
    shape66.visible:=true;
    terugdraaien();
  end;
    Iksor(check32);
  if check32=true then
  begin
  end
  else
  begin
    shape69.visible := true;
  end;
end;

procedure TForm1.Shape10MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
var
  check10: boolean;
begin
  (Sender as Tshape).Visible:= false;
  omgedraaiden[10]:= true;
  If (omgedraaiden[10] = true) AND (omgedraaiden[24] = true) then
  begin
    memory();//roept procedure aan
    shape44.visible:=true;
    shape58.visible:=true;
    terugdraaien();
  end;
    Iksor(check10);
  if check10=true then
  begin
  end
  else
  begin
    shape69.visible := true;
  end;
end;


procedure TForm1.Shape24MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);

var
  check24: boolean;
begin
  (Sender as Tshape).Visible:= false;
  omgedraaiden[24]:= true;
  If (omgedraaiden[24] = true) AND (omgedraaiden[10] = true) then
  begin
    memory();//roept procedure aan
    shape44.visible:=true;
    shape58.visible:=true;
    terugdraaien();
  end;
    Iksor(check24);
  if check24=true then
  begin
  end
  else
  begin
    shape69.visible := true;
  end;
end;


procedure TForm1.Shape11MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);

var
  check11: boolean;
begin
  (Sender as Tshape).Visible:= false;
  omgedraaiden[11]:= true;
  If (omgedraaiden[11] = true) AND (omgedraaiden[18] = true) then
  begin
    memory();//roept procedure aan
    shape45.visible:=true;
    shape52.visible:=true;
    terugdraaien();
  end;
    Iksor(check11);
  if check11=true then
  begin
  end
  else
  begin
    shape69.visible := true;
  end;
end;


procedure TForm1.Shape18MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);

var
  check18: boolean;
begin
  (Sender as Tshape).Visible:= false;
  omgedraaiden[18]:= true;
  If (omgedraaiden[18] = true) AND (omgedraaiden[11] = true) then
  begin
    memory();//roept procedure aan
    shape45.visible:=true;
    shape52.visible:=true;
    terugdraaien();
  end;
    Iksor(check18);
  if check18=true then
  begin
  end
  else
  begin
    shape69.visible := true;
  end;
end;

procedure TForm1.Shape12MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);

var
  check12: boolean;
begin
  (Sender as Tshape).Visible:= false;
  omgedraaiden[12]:= true;
  If (omgedraaiden[12] = true) AND (omgedraaiden[27] = true) then
  begin
    memory();//roept procedure aan
    shape46.visible:=true;
    shape61.visible:=true;
    terugdraaien();
  end;
    Iksor(check12);
  if check12=true then
  begin
  end
  else
  begin
    shape69.visible := true;
  end;
end;

procedure TForm1.Shape27MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);

var
  check27: boolean;
begin
  (Sender as Tshape).Visible:= false;
  omgedraaiden[27]:= true;
  If (omgedraaiden[27] = true) AND (omgedraaiden[12] = true) then
  begin
    memory();//roept procedure aan
    shape46.visible:=true;
    shape61.visible:=true;
    terugdraaien();
  end;
    Iksor(check27);
  if check27=true then
  begin
  end
  else
  begin
    shape69.visible := true;
  end;
end;


procedure TForm1.Shape13MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);

var
  check13: boolean;
begin
  (Sender as Tshape).Visible:= false;
  omgedraaiden[13]:= true;
  If (omgedraaiden[13] = true) AND (omgedraaiden[30] = true) then
  begin
    memory();//roept procedure aan
    shape47.visible:=true;
    shape64.visible:=true;
    terugdraaien();
  end;
    Iksor(check13);
  if check13=true then
  begin
  end
  else
  begin
    shape69.visible := true;
  end;
end;

procedure TForm1.Shape30MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);

var
  check30: boolean;
begin
  (Sender as Tshape).Visible:= false;
  omgedraaiden[30]:= true;
  If (omgedraaiden[30] = true) AND (omgedraaiden[13] = true) then
  begin
    memory();//roept procedure aan
    shape47.visible:=true;
    shape64.visible:=true;
    terugdraaien();
  end;
    Iksor(check30);
  if check30=true then
  begin
  end
  else
  begin
    shape69.visible := true;
  end;
end;


procedure TForm1.Shape14MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);

var
  check14: boolean;
begin
  (Sender as Tshape).Visible:= false;
  omgedraaiden[14]:= true;
  If (omgedraaiden[14] = true) AND (omgedraaiden[16] = true) then
  begin
    memory();//roept procedure aan
    shape48.visible:=true;
    shape50.visible:=true;
    terugdraaien();
  end;
    Iksor(check14);
  if check14=true then
  begin
  end
  else
  begin
    shape69.visible := true;
  end;
end;


procedure TForm1.Shape16MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);

var
  check16: boolean;
begin
  (Sender as Tshape).Visible:= false;
  omgedraaiden[16]:= true;
  If (omgedraaiden[16] = true) AND (omgedraaiden[14] = true) then
  begin
    memory();//roept procedure aan
    shape48.visible:=true;
    shape50.visible:=true;
    terugdraaien();
  end;
    Iksor(check16);
  if check16=true then
  begin
  end
  else
  begin
    shape69.visible := true;
  end;
end;


procedure TForm1.Shape15MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);

var
  check15: boolean;
begin
  (Sender as Tshape).Visible:= false;
  omgedraaiden[15]:= true;
  If (omgedraaiden[15] = true) AND (omgedraaiden[22] = true) then
  begin
    memory();//roept procedure aan
    shape49.visible:=true;
    shape56.visible:=true;
    terugdraaien();
  end;
    Iksor(check15);
  if check15=true then
  begin
  end
  else
  begin
    shape69.visible := true;
  end;
end;

procedure TForm1.Shape22MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);

var
  check22: boolean;
begin
  (Sender as Tshape).Visible:= false;
  omgedraaiden[22]:= true;
  If (omgedraaiden[22] = true) AND (omgedraaiden[15] = true) then
  begin
    memory();//roept procedure aan
    shape49.visible:=true;
    shape56.visible:=true;
    terugdraaien();
  end;
    Iksor(check22);
  if check22=true then
  begin
  end
  else
  begin
    shape69.visible := true;
  end;
end;

procedure TForm1.Shape34MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
var
  check34: boolean;
begin
  (Sender as Tshape).Visible:= false;
  omgedraaiden[34]:= true;
  If (omgedraaiden[34] = true) AND (omgedraaiden[17] = true) then
  begin
    memory();//roept procedure aan
    shape51.visible:=true;
    shape68.visible:=true;
    terugdraaien();
  end;
    Iksor(check34);
  if check34=true then
  begin
  end
  else
  begin
    shape69.visible := true;
  end;
end;


procedure TForm1.Shape19MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
var
  check19: boolean;
begin
  (Sender as Tshape).Visible:= false;
  omgedraaiden[19]:= true;
  If (omgedraaiden[19] = true) AND (omgedraaiden[26] = true) then
  begin
    memory();//roept procedure aan
    shape53.visible:=true;
    shape60.visible:=true;
    terugdraaien();
  end;
    Iksor(check19);
  if check19=true then
  begin
  end
  else
  begin
    shape69.visible := true;
  end;
end;


procedure TForm1.Shape26MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
var
  check26: boolean;
begin
  (Sender as Tshape).Visible:= false;
  omgedraaiden[26]:= true;
  If (omgedraaiden[26] = true) AND (omgedraaiden[19] = true) then
  begin
    memory();//roept procedure aan
    shape53.visible:=true;
    shape60.visible:=true;
    terugdraaien();
  end;
    Iksor(check26);
  if check26=true then
  begin
  end
  else
  begin
    shape69.visible := true;
  end;
end;


procedure TForm1.Shape20MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);

var
  check20: boolean;
begin
  (Sender as Tshape).Visible:= false;
  omgedraaiden[20]:= true;
  If (omgedraaiden[20] = true) AND (omgedraaiden[29] = true) then
  begin
    memory();//roept procedure aan
    shape54.visible:=true;
    shape63.visible:=true;
    terugdraaien();
  end;
    Iksor(check20);
  if check20=true then
  begin
  end
  else
  begin
    shape69.visible := true;
  end;
end;


procedure TForm1.Shape29MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
var
  check29: boolean;
begin
  (Sender as Tshape).Visible:= false;
  omgedraaiden[29]:= true;
  If (omgedraaiden[29] = true) AND (omgedraaiden[20] = true) then
  begin
    memory();//roept procedure aan
    shape54.visible:=true;
    shape63.visible:=true;
    terugdraaien();
  end;
    Iksor(check29);
  if check29=true then
  begin
  end
  else
  begin
    shape69.visible := true;
  end;
end;

procedure TForm1.Shape21MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
var
  check21: boolean;
begin
  (Sender as Tshape).Visible:= false;
  omgedraaiden[21]:= true;
  If (omgedraaiden[21] = true) AND (omgedraaiden[33] = true) then
  begin
    memory();//roept procedure aan
    shape55.visible:=true;
    shape67.visible:=true;
    terugdraaien();
  end;
    Iksor(check21);
  if check21=true then
  begin
  end
  else
  begin
    shape69.visible := true;
  end;
end;

procedure TForm1.Shape33MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);

var
  check33: boolean;
begin
  (Sender as Tshape).Visible:= false;
  omgedraaiden[33]:= true;
  If (omgedraaiden[33] = true) AND (omgedraaiden[21] = true) then
  begin
    memory();//roept procedure aan
    shape55.visible:=true;
    shape67.visible:=true;
    terugdraaien();
  end;
    Iksor(check33);
  if check33=true then
  begin
  end
  else
  begin
    shape69.visible := true;
  end;
end;


procedure TForm1.Shape23MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
var
  check23: boolean;
begin
  (Sender as Tshape).Visible:= false;
  omgedraaiden[23]:= true;
  If (omgedraaiden[23] = true) AND (omgedraaiden[31] = true) then
  begin
    memory();//roept procedure aan
    shape57.visible:=true;
    shape65.visible:=true;
    terugdraaien();
  end;
    Iksor(check23);
  if check23=true then
  begin
  end
  else
  begin
    shape69.visible := true;
  end;
end;


procedure TForm1.Shape31MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
var
  check31: boolean;
begin
  (Sender as Tshape).Visible:= false;
  omgedraaiden[31]:= true;
  If (omgedraaiden[31] = true) AND (omgedraaiden[23] = true) then
  begin
    memory();//roept procedure aan
    shape57.visible:=true;
    shape65.visible:=true;
    terugdraaien();
  end;
    Iksor(check31);
  if check31=true then
  begin
  end
  else
  begin
    shape69.visible := true;
  end;
end;


procedure TForm1.Shape25MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
var
  check25: boolean;
begin
  (Sender as Tshape).Visible:= false;
  omgedraaiden[25]:= true;
  If (omgedraaiden[25] = true) AND (omgedraaiden[28] = true) then
  begin
    memory();//roept procedure aan
    shape59.visible:=true;
    shape62.visible:=true;
    terugdraaien();
  end;
    Iksor(check25);
  if check25=true then
  begin
  end
  else
  begin
    shape69.visible := true;
  end;
end;


procedure TForm1.Shape28MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
var
  check28: boolean;
begin
  (Sender as Tshape).Visible:= false;
  omgedraaiden[28]:= true;
  If (omgedraaiden[28] = true) AND (omgedraaiden[25] = true) then
  begin
    memory();//roept procedure aan
    shape59.visible:=true;
    shape62.visible:=true;
    terugdraaien();
  end;
    Iksor(check28);
  if check28=true then
  begin
  end
  else
  begin
    shape69.visible := true;
  end;
end;

procedure TForm1.Shape69MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
  terugdraaien();
  omgedraaid();
  shape69.Visible:=false;
end;

end.

