Programalama > PASCAL

Etiketler: zeka, oyunu

Ort. 0
Puan ver:
uses crt,dos,graph;
const
{BUTONUN PASIF OLMA KORDINATLARI}
buton_pasif:array [0..14,0..3] of integer= (
(1,40,0,15),(1,1,1,15), (60,1,1,15),(2,39,0,15),(2,2,1,15), (59,2,1,15),
(1,40,0,8), (60,40,1,8),(60,1,1,8), (2,39,0,8), (59,39,1,8),(59,2,1,8),
(3,38,0,8), (58,38,1,88),(58,3,1,88)       );

{BUTONUN AKTIF OLMA KORDINATLARI}
buton_aktif:array [0..17,0..3] of integer= (
(1,40,0,8),(1,1,1,8), (60,1,1,8),(2,39,0,8),(2,2,1,8), (59,2,1,8),
(3,38,0,8),(3,3,1,8), (58,3,1,8),
(1,40,0,15), (60,40,1,15),(60,1,1,15), (2,39,0,15), (59,39,1,15),(59,2,1,15),
(3,38,0,15), (58,38,1,15),(58,3,1,15)      );

{BUTONUN YARI AKTIF OLMA KORDINATLARI}
buton_yari_aktif:array [0..9,0..3] of integer= (
(1,1,0,15),(1,40,1,15),(60,40,1,15),(60,1,1,15),(1,1,1,15),
(2,3,0,15),(2,39,1,15),(59,39,1,15),(59,2,1,15),(2,2,1,15)
                                               );
{BUTONUN USTUNE YAZILACAK LEVER ADLARI }
lever_yaz:array[0..9] of string=(
'Lvr 1','Lvr 2','Lvr 3','Lvr 4','Lvr 5','Lvr 6',
'Lvr 7','Lvr 8','Lvr 9','Lvr 10'
                                );
{ LEE KARAKTERININ GERIYE GIDERKEN KI KORDINATLARI }
lee_geri:array[0..39,0..4]of integer=((17,9,0,0,0),(17,9,1,0,0),
                                      (25,9,0,0,0),(25,9,1,0,0),
 (20,12,0,1,0),(17,9,0,1,1),(25,9,0,1,1),(18,17,0,0,0),(23,17,1,0,0),
 {g”vde ve bacaklar}
 (15,20,0,0,0),(15,25,1,0,0),(10,22,1,0,0),(8,30,1,0,0),(20,32,1,0,0),
 (21,36,1,0,0),(29,36,1,0,0),(28,30,1,0,0),(25,25,1,0,0),(25,20,1,0,0),(15,20,1,0,0),
 {kollar}
 (7,13,0,0,0),(5,16,1,0,0),(15,24,1,0,0),(15,20,1,0,0),(7,13,1,0,0),
 (17,27,0,0,0),(17,32,1,0,0),(25,23,1,0,0),(25,19,1,0,0),(17,27,1,0,0),
 {ayakkabilar}
 (9,21,0,0,0),(7,30,1,0,0),(4,28,1,0,0),(7,18,1,0,0),(9,20,1,0,0),
 (21,35,0,0,0),(30,35,1,0,0),(30,37,1,0,0),(21,37,1,0,0),(21,35,1,0,0)
 );
{ LEE KARAKTERININ ILERI GIDERKEN KI KORDINATLARI }
lee_ileri:array[0..41,0..4]of integer=(

 (11,9,0,0,0),(11,9,1,0,0),(19,9,0,0,0),(19,9,1,0,0),
 (14,12,0,1,0),(11,9,0,1,1),(19,9,0,1,1),(12,15,0,0,0),(18,18,1,0,0),
                                         (12,18,1,0,0),(12,15,1,0,0),
{g”vde ve bacaklar}
 (09,20,0,0,0),(09,24,1,0,0),(6,30,1,0,0),(6,35,1,0,0),(14,35,1,0,0),
 (14,33,1,0,0),(26,30,1,0,0),(23,23,1,0,0),(19,25,1,0,0),(19,20,1,0,0),(09,20,1,0,0),
{kollar}
 (27,13,0,0,0),(29,15,1,0,0),(19,25,1,0,0),(19,20,1,0,0),(27,13,1,0,0),
 (21,27,0,0,0),(19,30,1,0,0),(7,23,1,0,0),(7,18,1,0,0),(22,27,1,0,0),
 {ayakkabilar}
 (23,23,0,0,0),(25,30,1,0,0),(28,29,1,0,0),(25,21,1,0,0),(23,23,1,0,0),
 (5,36,0,0,0), (14,36,1,0,0),(14,37,1,0,0),(5,37,1,0,0),(5,35,1,0,0)
 );
{ HEDEFLARE KOYULACAK KASA NESNESININ ORDINATLARI }
kasa:array[0..44,0..3] of integer=(
(2,38,0,15),(2,2,1,15),(38,2,1,15),(38,38,1,88),(2,38,1,88),
(3,37,0,7), (3,3,1,7), (37,3,1,7), (37,37,1,7), (3,37,1,7),
(4,36,0,7), (4,4,1,7), (36,4,1,7), (36,36,1,7), (4,36,1,7),
(5,35,0,7), (5,5,1,7), (35,5,1,7), (35,35,1,7), (5,35,1,7),
(6,34,0,7), (6,6,1,7), (34,6,1,7), (34,34,1,7), (6,34,1,7),
(7,33,0,7), (7,7,1,7), (33,7,1,7), (33,33,1,7), (7,33,1,7),
(8,32,0,7), (8,8,1,7), (32,8,1,7), (32,32,1,7), (8,32,1,7),
(9,31,0,7), (9,9,1,7), (31,9,1,7), (31,31,1,7), (9,31,1,7),
(10,30,0,88),(10,10,1,88),(30,10,1,88),(30,30,1,15),(10,30,1,15)
);

{ BOXWORLD YAZISININ 'B' KARAKTERI }
iB:array[0..9,0..7] of integer=((1,1,1,1,1,1,1,0),
                               (1,1,1,1,1,1,1,1),
                               (1,1,0,0,0,0,1,1),
                               (1,1,0,0,0,0,1,1),
                               (1,1,1,1,1,1,1,0),
                               (1,1,1,1,1,1,1,0),
                               (1,1,0,0,0,0,1,1),
                               (1,1,0,0,0,0,1,1),
                               (1,1,1,1,1,1,1,1),
                               (1,1,1,1,1,1,1,0));
{ BOXWORLD YAZISININ 'O' KARAKTERI }
iO:array[0..9,0..7] of integer=((0,1,1,1,1,1,1,0),
                               (1,1,1,1,1,1,1,1),
                               (1,1,0,0,0,0,1,1),
                               (1,1,0,0,0,0,1,1),
                               (1,1,0,0,0,0,1,1),
                               (1,1,0,0,0,0,1,1),
                               (1,1,0,0,0,0,1,1),
                               (1,1,0,0,0,0,1,1),
                               (1,1,1,1,1,1,1,1),
                               (0,1,1,1,1,1,1,0));
{ BOXWORLD YAZISININ 'X' KARAKTERI }
iX:array[0..9,0..7] of integer=((1,1,0,0,0,0,1,1),
                                (1,1,0,0,0,0,1,1),
                                (0,1,1,0,0,1,1,0),
                                (0,1,1,0,0,1,1,0),
                                (0,0,1,1,1,1,0,0),
                                (0,0,0,1,1,0,0,0),
                                (0,1,1,1,1,1,1,0),
                                (0,1,1,0,0,1,1,0),
                                (1,1,0,0,0,0,1,1),
                                (1,1,0,0,0,0,1,1));
{ BOXWORLD YAZISININ 'W' KARAKTERI }
iW:array[0..9,0..7] of integer=((1,1,0,0,0,0,1,1),
                                (1,1,0,0,0,0,1,1),
                                (1,1,0,0,0,0,1,1),
                                (1,1,0,0,0,0,1,1),
                                (1,1,0,0,0,0,1,1),
                                (1,1,0,1,1,0,1,1),
                                (1,1,0,1,1,0,1,1),
                                (1,1,0,1,1,0,1,1),
                                (0,1,1,0,0,1,1,0),
                                (0,0,1,0,0,1,0,0));
{ BOXWORLD YAZISININ 'O' KARAKTERI }
iO2:array[0..9,0..7] of integer=((0,1,1,1,1,1,1,0),
                                (1,1,1,1,1,1,1,1),
                                (1,1,0,0,0,0,1,1),
                                (1,1,0,0,0,0,1,1),
                                (1,1,0,0,0,0,1,1),
                                (1,1,0,0,0,0,1,1),
                                (1,1,0,0,0,0,1,1),
                                (1,1,0,0,0,0,1,1),
                                (1,1,1,1,1,1,1,1),
                                (0,1,1,1,1,1,1,0));
{ BOXWORLD YAZISININ 'R' KARAKTERI }
iR:array[0..9,0..7] of integer=((1,1,1,1,1,1,1,0),
                                (1,1,1,1,1,1,1,1),
                                (1,1,0,0,0,0,1,1),
                                (1,1,0,0,0,0,1,1),
                                (1,1,1,1,1,1,1,1),
                                (1,1,1,1,1,1,1,0),
                                (1,1,0,1,1,0,0,0),
                                (1,1,0,0,1,1,0,0),
                                (1,1,0,0,0,1,1,0),
                                (1,1,0,0,0,0,1,1));
{ BOXWORLD YAZISININ 'L' KARAKTERI }
iL:array[0..9,0..7] of integer=((1,1,0,0,0,0,0,0),
                                (1,1,0,0,0,0,0,0),
                                (1,1,0,0,0,0,0,0),
                                (1,1,0,0,0,0,0,0),
                                (1,1,0,0,0,0,0,0),
                                (1,1,0,0,0,0,0,0),
                                (1,1,0,0,0,0,0,0),
                                (1,1,0,0,0,0,0,0),
                                (1,1,1,1,1,1,1,1),
                                (1,1,1,1,1,1,1,1));
{ BOXWORLD YAZISININ 'D' KARAKTERI }
iD:array[0..9,0..7] of integer=((1,1,1,1,1,1,1,0),
                                (1,1,1,1,1,1,1,1),
                                (1,1,0,0,0,0,1,1),
                                (1,1,0,0,0,0,1,1),
                                (1,1,0,0,0,0,1,1),
                                (1,1,0,0,0,0,1,1),
                                (1,1,0,0,0,0,1,1),
                                (1,1,0,0,0,0,1,1),
                                (1,1,1,1,1,1,1,1),
                                (1,1,1,1,1,1,1,0));

label
tekrar_basla,devam_lever,mouse_oku;
var
ks_gr_dn:array [0..3]of integer;
le_gr_dn:array [0..3]of integer;

regs:registers;
m_x,m_y,m_button,mo_x,mo_y,mo_button:integer;
x1,y1,x2,y2:integer;

kx1,ky1,kx2,ky2,kx3,ky3,kx4,ky4,kx5,ky5,kx6,ky6:integer;

K1,K2,K3,K4,K5,K6:BOOLEAN;
cx1,cx2,cx3,cx4,cx5,cx6:integer;
cy1,cy2,cy3,cy4,cy5,cy6:integer;

btn1,btn2,btn3,btn4,btn5,btn6,btn7,btn8,btn9,btn10:boolean;
acilis,btn_ustunde:boolean;
kx,ky:integer;
sx,sy:integer;
yx,yy:integer;
mx,my:integer;
renkkontrol:byte;
s1,s2,s3:string;
gd,gm:integer;
x,y,a,a1,a2,ks:integer;
deg:string;
lever_ata:byte;
tus:char;
cal,oyun_aktif:boolean;
dur:longint;
eniyi_tasima,sizin_tasima:integer;

kx1_boya,kx2_boya,kx3_boya,kx4_boya,kx5_boya,kx6_boya:boolean;
k1_ok,k2_ok,k3_ok,k4_ok,k5_ok,k6_ok:boolean;
bitis,hdf_say:byte;
{ GRAFIK EKRANE GECIS PROCEDUR U }
procedure grafik;
begin
gd:=detect;
initgraph(gd,gm,'c:\progra~1\tpascal\bgi');
if graphresult<>0 then begin write('hata'); readln; halt; end;

end;

function mouseinit:boolean;
var
t:integer;
begin
asm
mov ax,0
int 33h
mov t,ax
end;
if t=0 then
mouseinit:=false else mouseinit:=true;
end;
procedure mousegoster;
begin
asm
mov ax,1
int 33h
end;
end;
procedure mousesakla;
begin
asm
mov ax,2
int 33h
end;
end;
procedure getmousecoords(var x,y,button:integer);
var xx,yy,bb:integer;
begin
asm
mov ax,3
int 33h
mov xx,cx
mov yy,dx
mov bb,bx
end;
x:=xx;
y:=yy;
button:=bb;
end;
{///////////////////         LEVER          /////////////////////////////}
{ CIRCLE HEDEFLERININ ICINI GRI VEYA KIRMIZI RENKTE DOLDURUR}
procedure circle_doldur(x,y,r,renk:integer);
var i:integer;
begin
if (getpixel(x+12,y-12)=7) then
begin setfillstyle(1,red);
end
else begin setfillstyle(1,yellow); end;
setcolor(yellow);
fillellipse(x,y,r,r);

end;

procedure lever1;
begin

setfillstyle(1,4);

bar(220,130,440,140);
bar(220,140,230,220);
bar(180,210,230,220);
bar(180,220,190,300);
bar(180,300,230,310);
bar(220,310,230,350);
bar(220,340,470,350);
bar(470,270,480,350);
bar(470,260,520,270);
bar(510,170,520,270);
bar(440,170,510,180);
bar(430,130,440,180);

bar(270,180,390,220);
bar(310,260,350,350);

setcolor(7);
circle(290,280,8); circle_doldur(290,280,8,7);
circle(250,280,8); circle_doldur(250,280,8,7);
circle(290,320,8); circle_doldur(290,320,8,7);
circle(250,320,8); circle_doldur(250,320,8,7);
cx1:=290; cx2:=250; cx3:=290; cx4:=250;
cy1:=280; cy2:=280; cy3:=320; cy4:=320;

k1:=true;k2:=true;k3:=true;k4:=true;
k5:=false;k6:=false;
eniyi_tasima:=27;
hdf_say:=4;
end;

procedure lever2;
begin

setfillstyle(1,4);
bar(200,150,340,160);
bar(200,150,210,290);
bar(200,280,290,290);
bar(280,280,290,360);
bar(240,350,290,360);
bar(240,350,250,450);
bar(240,440,380,450);
bar(370,400,380,450);
bar(370,400,500,410);
bar(490,230,500,410);
bar(440,230,500,240);
bar(440,240,450,320);
bar(330,310,450,320);
bar(330,150,340,320); bar(370,360,410,400);
setcolor(7);
circle(470,260,8); circle_doldur(470,260,8,7);
circle(470,300,8); circle_doldur(470,300,8,7);
circle(470,340,8); circle_doldur(470,340,8,7);
cx1:=470; cx2:=470; cx3:=470;
cy1:=260; cy2:=300; cy3:=340;
k1:=true;k2:=true;k3:=true;
k4:=false;k5:=false;k6:=false;
eniyi_tasima:=31;
hdf_say:=3;
end;

procedure lever3;
begin

setfillstyle(1,4);
bar(240,90,460,100);
bar(240,90,250,140);
bar(120,130,250,140);
bar(120,130,130,350);
bar(120,340,170,350);
bar(160,340,170,470);
bar(160,460,580,470);
bar(570,370,580,470);
bar(490,370,580,380);
bar(490,220,500,380);
bar(450,210,500,220);
bar(450,90,460,210); {}
bar(250,180,290,220); bar(290,140,410,180);
bar(170,180,210,300); bar(210,300,250,340);
bar(210,380,330,420); bar(330,340,370,380);
bar(410,260,450,380); bar(370,220,410,260);
bar(370,420,450,460);
setcolor(7);
circle(270,160,8); circle_doldur(270,160,8,7);
circle(190,320,8); circle_doldur(190,320,8,7);
circle(350,400,8); circle_doldur(350,400,8,7);
circle(430,240,8); circle_doldur(430,240,8,7);
circle(310,280,8); circle_doldur(310,280,8,7);

cx1:=270; cx2:=190; cx3:=350; cx4:=430; cx5:=310;
cy1:=160; cy2:=320; cy3:=400; cy4:=240; cy5:=280;
k1:=true;k2:=true;k3:=true;k4:=true;k5:=true;
k6:=false;
eniyi_tasima:=22;
hdf_say:=5;
end;

procedure lever4;
begin
setfillstyle(1,4);
bar(250,110,470,120);
bar(250,120,260,160);
bar(210,150,260,160);
bar(210,150,220,320);
bar(130,310,210,320);
bar(130,310,140,370);
bar(130,360,430,370);
bar(420,280,430,370);
bar(430,280,470,290);
bar(460,110,470,290);
{} bar(340,120,380,200);
   bar(300,240,340,280); bar(340,240,380,320);
   setcolor(7);
circle(160,340,8); circle_doldur(160,340,8,7);
circle(200,340,8); circle_doldur(200,340,8,7);
circle(240,340,8); circle_doldur(240,340,8,7);
circle(280,340,8); circle_doldur(280,340,8,7);
circle(320,340,8); circle_doldur(320,340,8,7);

cx1:=160; cx2:=200; cx3:=240; cx4:=280; cx5:=320;
cy1:=340; cy2:=340; cy3:=340; cy4:=340; cy5:=340;
k1:=true;k2:=true;k3:=true;k4:=true;k5:=true;
k6:=false;
eniyi_tasima:=30;
hdf_say:=5;
end;

procedure lever5;
begin
setfillstyle(1,4);
bar(280,120,460,130);
bar(280,120,290,170);
bar(200,160,290,170);
bar(200,160,210,210);
bar(160,200,210,210);
bar(160,200,170,300);
bar(160,290,370,300);
bar(360,290,370,340);
bar(360,330,460,340);
bar(450,250,460,340);
bar(450,250,500,260);
bar(490,200,500,260);
bar(450,200,500,210);
bar(450,120,460,210);  bar(330,170,410,210);
setcolor(7);
circle(230,190,8); circle_doldur(230,190,8,7);
circle(230,230,8); circle_doldur(230,230,8,7);
circle(230,270,8); circle_doldur(230,270,8,7);
circle(190,230,8); circle_doldur(190,230,8,7);
circle(190,270,8); circle_doldur(190,270,8,7);

cx1:=230; cx2:=230; cx3:=230; cx4:=190; cx5:=190;
cy1:=190; cy2:=230; cy3:=270; cy4:=230; cy5:=270;

k1:=true;k2:=true;k3:=true;k4:=true;k5:=true;
k6:=false;

eniyi_tasima:=16;

hdf_say:=5;
end;

procedure lever6;
begin
setfillstyle(1,4);
bar(200,130,490,140);  bar(290,140,370,180);
bar(200,130,210,340);
bar(160,330,210,340);  bar(290,220,410,260);
bar(160,330,170,430);  bar(250,260,290,340);
bar(160,420,530,430);  bar(410,260,450,340);
bar(530,330,540,430);
bar(490,330,540,340);  bar(370,380,410,420);
bar(490,130,500,340);
setcolor(7);
circle(310,280,8); circle_doldur(310,280,8,7);
circle(350,280,8); circle_doldur(350,280,8,7);
circle(390,280,8); circle_doldur(390,280,8,7);
circle(310,320,8); circle_doldur(310,320,8,7);
circle(350,320,8); circle_doldur(350,320,8,7);
circle(390,320,8); circle_doldur(390,320,8,7);

cx1:=310; cx2:=350; cx3:=390; cx4:=310; cx5:=350; cx6:=390;
cy1:=280; cy2:=280; cy3:=280; cy4:=320; cy5:=320; cy6:=320;
k1:=true;k2:=true;k3:=true;k4:=true;k5:=true;k6:=true;

eniyi_tasima:=39;

hdf_say:=6;
end;

procedure lever7;
begin
setfillstyle(1,4);
bar(290,150,470,160);
bar(290,150,300,240);
bar(210,230,300,240);
bar(210,230,220,330);
bar(210,320,340,330);
bar(330,320,340,370);
bar(330,360,430,370);
bar(420,280,430,370);
bar(420,280,470,290);
bar(460,150,470,290);
setcolor(7);

circle(360,260,8); circle_doldur(360,260,8,7);
circle(400,260,8); circle_doldur(400,260,8,7);
circle(320,300,8); circle_doldur(320,300,8,7);
circle(360,300,8); circle_doldur(360,300,8,7);
circle(400,300,8); circle_doldur(400,300,8,7);

cx1:=360; cx2:=400; cx3:=320; cx4:=360; cx5:=400;
cy1:=260; cy2:=260; cy3:=300; cy4:=300; cy5:=300;

k1:=true;k2:=true;k3:=true;k4:=true;k5:=true;
k6:=false;
eniyi_tasima:=13;

hdf_say:=5;
end;

procedure lever8;
begin
setfillstyle(1,4);
bar(200,150,300,160);
bar(200,150,210,200);
bar(160,190,210,200);
bar(160,190,170,290);
bar(160,280,210,290);
bar(200,280,210,330);
bar(200,320,540,330);
bar(530,280,540,330);
bar(530,280,580,290);
bar(570,150,580,290);
bar(440,150,580,160);
bar(440,150,450,240);
bar(290,230,450,240);  bar(370,280,410,320);
bar(290,150,300,240);
setcolor(7);
circle(310,260,8); circle_doldur(310,260,8,7);
circle(350,260,8); circle_doldur(350,260,8,7);
circle(390,260,8); circle_doldur(390,260,8,7);
circle(430,260,8); circle_doldur(430,260,8,7);

cx1:=310; cx2:=350; cx3:=390; cx4:=430;
cy1:=260; cy2:=260; cy3:=260; cy4:=260;
k1:=true;k2:=true;k3:=true;k4:=true;k5:=false;
k6:=false;
eniyi_tasima:=18;
hdf_say:=4;
end;

procedure lever9;
begin
setfillstyle(1,4);
bar(290,150,430,160);
bar(290,150,300,200);
bar(210,190,300,200);
bar(210,190,220,290);
bar(210,280,300,290);
bar(290,280,300,370);
bar(290,360,430,370);
bar(420,320,430,370);
bar(420,320,470,330);
bar(460,230,470,330);
bar(420,230,470,240);
bar(420,150,430,240);
setcolor(7);
circle(320,260,8); circle_doldur(320,260,8,7);
circle(400,260,8); circle_doldur(400,260,8,7);
circle(360,220,8); circle_doldur(360,220,8,7);
circle(360,300,8); circle_doldur(360,300,8,7);

cx1:=320; cx2:=400; cx3:=360; cx4:=360;
cy1:=260; cy2:=260; cy3:=220; cy4:=300;

k1:=true;k2:=true;k3:=true;k4:=true;
k5:=false;k6:=false;
eniyi_tasima:=7;
hdf_say:=4;
end;

procedure lever10;
begin
setfillstyle(1,4);
bar(290,120,390,130);
bar(290,130,300,210);
bar(250,200,300,210);
bar(250,200,260,290);
bar(210,280,260,290);
bar(210,280,220,380);
bar(210,370,470,380);
bar(460,280,470,380);
bar(420,280,470,290);
bar(420,200,430,290);
bar(380,200,430,210);
bar(380,120,390,210);
bar(300,290,340,330);
setcolor(7);

circle(320,150,8); circle_doldur(320,150,8,7);
circle(360,150,8); circle_doldur(360,150,8,7);
circle(360,190,8); circle_doldur(360,190,8,7);
circle(400,230,8); circle_doldur(400,230,8,7);

cx1:=320; cx2:=360; cx3:=360; cx4:=400;
cy1:=150; cy2:=150; cy3:=190; cy4:=230;

k1:=true;k2:=true;k3:=true;k4:=true;
k5:=false;k6:=false;

eniyi_tasima:=16;
hdf_say:=4;
end;

{/////////////////////LEVER       //////////////////////////////////////}

{ ISTENILEN KORDINATLARA PENCERE CIZER }
procedure pencere(px1,py1,px2,py2:integer);
begin
setcolor(15); moveto(px1,py2); lineto(px1,py1); lineto(px2,py1);
setcolor(88); lineto(px2,py2); lineto(px1,py2);
setcolor(15); moveto(px1+3,py2-4); lineto(px2-4,py2-4); lineto(px2-4,py1+4);
setcolor(88); lineto(px1+3,py1+4); lineto(px1+4,py2-4);
setcolor(7);
for a:=1 to 3 do
begin
moveto(px1+a,py2-a); lineto(px1+a,py1+a); lineto(px2-a,py1+a);
lineto(px2-a,py2-a); lineto(px1+a,py2-a);
moveto(px1+a,py2-a); lineto(px2-a,py2-a); lineto(px2-a,py1+a);
lineto(px1+a,py1+a); lineto(px1+a,py2-a);
end;

end;

procedure cerceve;
begin

setcolor(white);
    line(100,75,610,75);   line(100,75,100,479);
    line(105,474,605,474); line(605,80,605,474);
setcolor(88);
   line(100,479,610,479); line(610,75,610,479);
   line(105,80,605,80);   line(105,80,105,474);
 setcolor(7);
  rectangle(101,76,609,478);  rectangle(102,77,608,477);
  rectangle(103,78,607,476);  rectangle(104,79,606,475);

end;
{ SECILEN LEVERI TANIR  }
procedure lever_goster;
begin
     mousesakla;
if lever_ata=0 then lever1;
if lever_ata=1 then lever2;
if lever_ata=2 then lever3;
if lever_ata=3 then lever4;
if lever_ata=4 then lever5;
if lever_ata=5 then lever6;
if lever_ata=6 then lever7;
if lever_ata=7 then lever8;
if lever_ata=8 then lever9;
if lever_ata=9 then lever10;
    mousegoster;
end;
{ TANINAN LEVER E AIT BUTONLARI DOSER  }
procedure butonlari_dose;
begin  mousesakla;
pencere(0,0,640,52);
for x:=0 to 9 do
begin
if lever_ata<>x then
begin
for y:=0 to 14 do
  begin
if buton_pasif[y,2]=0 then
moveto(buton_pasif[y,0]+x*63+5,buton_pasif[y,1]+5)
else begin  setcolor(buton_pasif[y,3]);
lineto(buton_pasif[y,0]+x*63+5,buton_pasif[y,1]+5);
     end;
  end;
setfillstyle(1,7);  bar(3+x*63+5,3+5,57+x*63+5,37+5);
setcolor(88);       outtextxy(10+x*63+5,15+5,lever_yaz[x]);
setcolor(15);       outtextxy(10+x*63+6,15+6,lever_yaz[x]);

end

 else
begin
     setfillstyle(1,7);  bar(4+x*63+5,4+5,57+x*63+5,37+5);
setcolor(15); outtextxy(10+x*63+5,15+5,lever_yaz[x]);
setcolor(88); outtextxy(10+x*63+6,15+6,lever_yaz[x]); end;

end;
   mousegoster;
END;

{ SECILEN BUTON DISINDAKI AKTIF BUTONLARI PASIF YAPAR}
procedure butonlari_pasifyap;
begin   mousesakla;
        setfillstyle(1,BLACK); bar(1,1,640,480);
for y:=0 to 17 do
  begin
       if buton_aktif[y,2]=0 then
          moveto(buton_aktif[y,0]+lever_ata*63+5,buton_aktif[y,1]+5)
          else
              begin
                   setcolor(buton_aktif[y,3]);
                   lineto(buton_aktif[y,0]+lever_ata*63+5,buton_aktif[y,1]+5);
              end;
end;
setfillstyle(1,7);  bar(4+lever_ata*63+5,4+5,57+lever_ata*63+5,37+5);

mousegoster;
end;
{ MOUSE ILE UZERINA GELINEN BUTONLARI YARI AKTIF YAPAR }
procedure butonlari_yari_aktifyap;
begin  mousesakla;

for y:=0 to 9 do
    begin
    if buton_yari_aktif[y,2]=0 then
       moveto(buton_yari_aktif[y,0]+lever_ata*63+5,buton_yari_aktif[y,1]+5)
       else
           begin
                setcolor(buton_yari_aktif[y,3]);
                lineto(buton_yari_aktif[y,0]+lever_ata*63+5,buton_yari_aktif[y,1]+5);
           end;
end;

btn_ustunde:=false;    mousegoster;
end;

{ YON TUSLARI ILE KORDINATLARI DEGISTIRILEN KASALARIN
YERINI DEGISTIRIR  }

procedure kasa_oynat;
begin  bitis:=0;   mousesakla;
if k1=true then
   begin
        if getpixel(cx1,cy1)=red then inc(bitis);
        for ks:=0 to 44 do  begin
            if kasa[ks,2]=0 then
               moveto(kasa[ks,0]+kx1,kasa[ks,1]+ky1)
               else
                   begin
                        setcolor(kasa[ks,3]);
                        lineto(kasa[ks,0]+kx1,kasa[ks,1]+ky1);
                   end;
        end;
   end;

if k2=true then
   begin
        if getpixel(cx2,cy2)=red then inc(bitis);
        for ks:=0 to 44 do
            begin
                 if kasa[ks,2]=0 then
                    moveto(kasa[ks,0]+kx2,kasa[ks,1]+ky2)
                    else
                    begin
                         setcolor(kasa[ks,3]);
                         lineto(kasa[ks,0]+kx2,kasa[ks,1]+ky2);
                    end;
            end;
   end;

if k3=true then
   begin
   if getpixel(cx3,cy3)=red then inc(bitis);
   for ks:=0 to 44 do
       begin
            if kasa[ks,2]=0 then
               moveto(kasa[ks,0]+kx3,kasa[ks,1]+ky3)
               else
               begin
                    setcolor(kasa[ks,3]);
                    lineto(kasa[ks,0]+kx3,kasa[ks,1]+ky3);
               end;
       end;
   end;

if k4=true then
   begin
   if getpixel(cx4,cy4)=red then inc(bitis);
   for ks:=0 to 44 do
       begin
            if kasa[ks,2]=0 then
               moveto(kasa[ks,0]+kx4,kasa[ks,1]+ky4)
               else
               begin
                    setcolor(kasa[ks,3]);
                    lineto(kasa[ks,0]+kx4,kasa[ks,1]+ky4);
               end;
       end;
   end;

if k5=true then
   begin
   if getpixel(cx5,cy5)=red then inc(bitis);
   for ks:=0 to 44 do
       begin
            if kasa[ks,2]=0 then
               moveto(kasa[ks,0]+kx5,kasa[ks,1]+ky5)
               else
               begin
                    setcolor(kasa[ks,3]);
                    lineto(kasa[ks,0]+kx5,kasa[ks,1]+ky5);
               end;
       end;
   end;

if k6=true then
   begin
   if getpixel(cx6,cy6)=red then inc(bitis);
   for ks:=0 to 44 do
       begin
       if kasa[ks,2]=0 then
          moveto(kasa[ks,0]+kx6,kasa[ks,1]+ky6)
          else
              begin
              setcolor(kasa[ks,3]);
              lineto(kasa[ks,0]+kx6,kasa[ks,1]+ky6);
              end;
       end;
   end;

if bitis=hdf_say then
   begin
   for a:=0 to 63 do
       begin
            setrgbpalette(yellow,0,a,a);
            SETCOLOR(yellow);
            outtextxy(150,60,'TEBRiKLER BiR SONRAKi LEVER e GE&#8364;EBiLiRSiNiZ');
       end;
   a:=0; randomize;
   repeat
         inc(a);
         sound(random(1000)*5); delay(1000); nosound;
   until (keypressed) or (a=150);
TUS:=#13;
end;
mousegoster;
end;
{ KASALARIN ADIMINA G&#8482;RE PUAN ALINMASI  }
procedure puan;
begin
     kasa_oynat;
     setfillstyle(1,BLACK);
     bar(10,100,85,160);
     bar(10,200,85,280);

     pencere(100,75,600,480);
     pencere(1,75,95,175);
     setcolor(yellow); settextstyle(2,0,4);
     outtextxy(25,85, '  ideal ');
     outtextxy(12,100,' Adim Sayisi');
     setcolor(white); settextstyle(2,0,20);
     str(eniyi_tasima,deg);
     outtextxy(30,120,deg);

     pencere(1,190,95,290);
     setcolor(yellow); settextstyle(2,0,4);
     outtextxy(27,200,' Sizin ');
     outtextxy(05,215,' Adim Sayiniz ');

     str(sizin_tasima,deg);
     setcolor(white); settextstyle(2,0,20);
     outtextxy(30,230,deg);
     settextstyle(0,0,0);

     pencere(1,305,95,430);
     setcolor(yellow); settextstyle(2,0,4);
     outtextxy(10,325, 'Hareket >  ');
     outtextxy(20,340, ' Y&#8221;n Tuslari ');
     outtextxy(10,360,'Geri  > END ');
     outtextxy(10,380,'Lever > ENTER ');
     outtextxy(10,400,'&#8364;ikis > ESC ');


     settextstyle(0,0,0);

     pencere(100,75,600,480);
     pencere(605,75,640,480);
     SETCOLOR(yellow);
     SETTEXTSTYLE(1,0,1);
     outtextxy(616,90, 'T');
     outtextxy(615,140,'A');
     outtextxy(615,190,'N');
     outtextxy(615,240,'S');
     outtextxy(617,290,'A');
     outtextxy(615,340,'L');
     outtextxy(617,390,'I');
     outtextxy(615,440,'&#8364;');

     SETTEXTSTYLE(2,0,4);
     setcolor(11); outtextxy(7,465,'Kadir Göksu');
     SETTEXTSTYLE(0,0,0);
end;



{  ///////////////      programin baslangici      \\\\\\\\\\\\\\\\\\\\\\\  }

begin

clrscr;
lever_ata:=15;
if not(mouseinit) then
   begin
        writeln('mouseinit yok');
        halt;
   end;
{Grafik Moda ge&#8225;}
grafik;
mousegoster;
getmousecoords(m_x,m_y,m_button);
mousesakla;
setfillstyle(1,BLACK); bar(1,1,640,480);
mousegoster;
acilis:=true;
tekrar_basla:
oyun_aktif:=false;
lever_ata:=15;
mo_x:=m_x;
mo_y:=m_y;
mo_button:=m_button;

{ butonlarin ekrana cizilmesi  }
butonlari_dose;

{baslangictaki boxworld yazisinin yazilmasi}

if acilis=true then
   begin
        acilis:=false;
        mousesakla;
        setfillstyle(1,yellow);
   for A1:=0 to 9 do
       for A2:=0 to 7 do
       begin

       if  iB[a1,a2]=1 then bar(50+a2*05 ,200+a1*05,55+a2*05 ,205+a1*05);
       if  iO[a1,a2]=1 then bar(120+a2*05,200+a1*05,125+a2*05,205+a1*05);
       if  iX[a1,a2]=1 then bar(190+a2*05,200+a1*05,195+a2*05,205+a1*05);
       if  iW[a1,a2]=1 then bar(260+a2*05,200+a1*05,265+a2*05,205+a1*05);
       if iO2[a1,a2]=1 then bar(330+a2*05,200+a1*05,335+a2*05,205+a1*05);
       if  iR[a1,a2]=1 then bar(400+a2*05,200+a1*05,405+a2*05,205+a1*05);
       if  iL[a1,a2]=1 then bar(470+a2*05,200+a1*05,475+a2*05,205+a1*05);
       if  iD[a1,a2]=1 then bar(540+a2*05,200+a1*05,545+a2*05,205+a1*05);

       end;
   pencere(30,180,600,275);
   mousegoster;
   end;

repeat

getmousecoords(m_x,m_y,m_button);

if (mo_x<>m_x) or (mo_y<>m_y) or (mo_button<>m_button) then
   begin
        mo_x:=m_x; mo_y:=m_y; mo_button:=m_button;
   end;
{ BUTON YARI AKTIF IKEN UZERINDEN CIKILDIGINDA PASIF OLMASI  }
if mo_button=0 then
   begin
   if ((mo_x>2)   and (mo_x<636) and (mo_y>2)   and (mo_y<6)) or
      ((mo_x>2)   and (mo_x<4)   and (mo_y>2)   and (mo_y<53)) or
      ((mo_x>2)   and (mo_x<636) and (mo_y>47)  and (mo_y<53)) or
      ((mo_x>632) and (mo_x<636) and (mo_y>2)   and (mo_y<53)) then

      begin
           btn1:=false; btn2:=false;btn3:=false;btn4:=false;btn5:=false;
           btn6:=false; btn7:=false;btn8:=false;btn9:=false;btn10:=false;
           lever_ata:=15;  butonlari_yari_aktifyap; butonlari_dose;
      end;

   if (mo_x>4) and (mo_x<66)and (mo_y>6) and (mo_y<48) then
      begin lever_ata:=0;
            if btn1=false then
               begin
                    butonlari_dose;
                    butonlari_yari_aktifyap;
               end;
            btn1:=true; btn2:=false;btn3:=false;btn4:=false;btn5:=false;
            btn6:=false; btn7:=false;btn8:=false;btn9:=false;btn10:=false;
      end;
{ BUTONLARIN KOSE KORDINATLARI  }
if (mo_x>67) and (mo_x<128)and (mo_y>6) and (mo_y<48) then
   begin lever_ata:=1;
         if btn2=false then
            begin
                 butonlari_dose;
                 butonlari_yari_aktifyap;
            end;
         btn1:=false; btn2:=true;btn3:=false;btn4:=false;btn5:=false;
         btn6:=false; btn7:=false;btn8:=false;btn9:=false;btn10:=false;
   end;
if (mo_x>130) and (mo_x<192) and (mo_y>6) and (mo_y<48) then
   begin  lever_ata:=2;
          if btn3=false then
             begin
                  butonlari_yari_aktifyap;
                  butonlari_dose;
             end;
          btn1:=false; btn2:=false;btn3:=true;btn4:=false;btn5:=false;
          btn6:=false; btn7:=false;btn8:=false;btn9:=false;btn10:=false;
   end;

if (mo_x>193) and (mo_x<255)and (mo_y>6) and (mo_y<48) then
   begin  lever_ata:=3;
          if btn4=false then
             begin
                  butonlari_yari_aktifyap;
                  butonlari_dose;
             end;
          btn1:=false; btn2:=false;btn3:=false;btn4:=true;btn5:=false;
          btn6:=false; btn7:=false;btn8:=false;btn9:=false;btn10:=false;
   end;

if (mo_x>256) and (mo_x<318)and (mo_y>6) and (mo_y<48) then
   begin  lever_ata:=4;
          if btn5=false then
             begin
                  butonlari_yari_aktifyap;
                  butonlari_dose;
             end;
          btn1:=false; btn2:=false;btn3:=false;btn4:=false;btn5:=true;
          btn6:=false; btn7:=false;btn8:=false;btn9:=false;btn10:=false;
   end;

if (mo_x>319) and (mo_x<381)and (mo_y>6) and (mo_y<48) then
   begin  lever_ata:=5;
          if btn6=false then
             begin
                  butonlari_yari_aktifyap;
                  butonlari_dose;
             end;
          btn1:=false; btn2:=false;btn3:=false;btn4:=false;btn5:=false;
          btn6:=true; btn7:=false;btn8:=false;btn9:=false;btn10:=false;
   end;

if (mo_x>382) and (mo_x<444)and (mo_y>6) and (mo_y<48) then
   begin  lever_ata:=6;
          if btn7=false then
             begin
                  butonlari_yari_aktifyap;
                  butonlari_dose;
             end;
          btn1:=false; btn2:=false;btn3:=false;btn4:=false;btn5:=false;
          btn6:=false; btn7:=true;btn8:=false;btn9:=false;btn10:=false;
   end;

if (mo_x>445) and (mo_x<507)and (mo_y>6) and (mo_y<48) then
   begin  lever_ata:=7;
          if btn8=false then
             begin
                  butonlari_yari_aktifyap;
                  butonlari_dose;
             end;
          btn1:=false; btn2:=false;btn3:=false;btn4:=false;btn5:=false;
          btn6:=false; btn7:=false;btn8:=true;btn9:=false;btn10:=false;
   end;

if (mo_x>508) and (mo_x<570)and (mo_y>6) and (mo_y<48) then
   begin  lever_ata:=8;
          if btn9=false then
             begin
                  butonlari_yari_aktifyap;
                  butonlari_dose;
             end;
          btn1:=false; btn2:=false;btn3:=false;btn4:=false;btn5:=false;
          btn6:=false; btn7:=false;btn8:=false;btn9:=true;btn10:=false;
   end;

if (mo_x>571) and (mo_x<632)and (mo_y>6) and (mo_y<48) then
   begin  lever_ata:=9;
          if btn10=false then
             begin
                  butonlari_yari_aktifyap;
                  butonlari_dose;
             end;
          btn1:=false; btn2:=false;btn3:=false;btn4:=false;btn5:=false;
          btn6:=false; btn7:=false;btn8:=false;btn9:=false;btn10:=true;
   end;

end;

{/////////////////////////////////////////////
//////////////////////////////////////////////////////////////////}

if mo_button=1 then
begin

{ BUTONA TIKLANDIGINDA MOUSE NIN SOL TUSUNUN BIRAKILMASI BEKLENIR  }

repeat
getmousecoords(m_x,m_y,m_button);

if (mo_x<>m_x) or (mo_y<>m_y) or (mo_button<>m_button) then
   begin
        mo_x:=m_x; mo_y:=m_y; mo_button:=m_button;
   end;

until mo_button=0;


if (mo_x>4) and (mo_x<66)and (mo_y>6) and (mo_y<48) then
   begin
        if mo_button=0 then
           begin
                setfillstyle(1,BLACK); bar(111,90,580,470);
                lever1;
                x1:=272;  y1:=225;  x2:=x1+30; y2:=y1+30;
                kx1:=230; ky1:=181;   kx2:=310; ky2:=221;
                kx3:=390; ky3:=261;   kx4:=430; ky4:=221;

                kasa_oynat;

                lever_ata:=0;
                butonlari_pasifyap; butonlari_dose;  oyun_aktif:=true;
                sizin_tasima:=0; puan;
           end;
   end;

if (mo_x>67) and (mo_x<128)and (mo_y>6) and (mo_y<48) then
   begin
        if mo_button=0 then begin
           setfillstyle(1,BLACK); bar(111,90,580,470);
           lever2;
           x1:=212;  y1:=165;  x2:=x1+30; y2:=y1+30;
           kx1:=250; ky1:=200;   kx2:=250; ky2:=240; kx3:=290; ky3:=200;

           kasa_oynat;
           lever_ata:=1;
           if mo_button=0 then
              begin
                   butonlari_pasifyap;
                   butonlari_dose;
              end;
           oyun_aktif:=true;
           if btn2=false then
              begin
                   butonlari_yari_aktifyap;
                   butonlari_dose;
              end;
           btn2:=true;

           sizin_tasima:=0; puan;
        end;
   end;

if (mo_x>130) and (mo_x<192) and (mo_y>6) and (mo_y<48) then
   begin
        if mo_button=0 then begin
           setfillstyle(1,BLACK); bar(111,90,580,470);
           lever3;
           x1:=533;  y1:=385;  x2:=x1+30; y2:=y1+30;
           kx1:=250; ky1:=220;   kx2:=330; ky2:=220;
           kx5:=290; ky5:=260;
           kx3:=250; ky3:=300;   kx4:=330; ky4:=300;
           kasa_oynat;
           lever_ata:=2;
           if mo_button=0 then
              begin
                   butonlari_pasifyap;
                   butonlari_dose;
              end;
           oyun_aktif:=true;
           sizin_tasima:=0;
           puan;
        end;
   end;

if (mo_x>193) and (mo_x<255)and (mo_y>6) and (mo_y<48) then
   begin
      if mo_button=0 then begin
        setfillstyle(1,BLACK); bar(111,90,580,470);
        lever4;
        x1:=423;  y1:=125;  x2:=x1+30; y2:=y1+30;
        kx1:=220; ky1:=200;   kx2:=300; ky2:=200;  kx3:=380; ky3:=200;
        kx4:=260; ky4:=240;   kx5:=260; ky5:=280;
        kasa_oynat;
        lever_ata:=3;
        if mo_button=0 then
           begin
                butonlari_pasifyap;
                butonlari_dose;
           end;
        oyun_aktif:=true;
        sizin_tasima:=0;
        puan;
      end;
   end;

if (mo_x>256) and (mo_x<318)and (mo_y>6) and (mo_y<48) then
   begin
        if mo_button=0 then
           begin
                setfillstyle(1,BLACK); bar(111,90,580,470);
                lever5;
                x1:=452;  y1:=215;  x2:=x1+30; y2:=y1+30;
                kx1:=290; ky1:=170;
                kx2:=250; ky2:=210;  kx3:=330; ky3:=210;
                kx4:=290; ky4:=250;   kx5:=370; ky5:=250;
                kasa_oynat;
                lever_ata:=4;
                if mo_button=0 then
                   begin
                        butonlari_pasifyap;
                        butonlari_dose;
                   end;
                oyun_aktif:=true;
                sizin_tasima:=0;
                puan;
           end;
   end;

if (mo_x>319) and (mo_x<381)and (mo_y>6) and (mo_y<48) then
   begin
        if mo_button=0 then begin
           setfillstyle(1,BLACK); bar(111,90,580,470);
           lever6;
           x1:=452;  y1:=385;  x2:=x1+30; y2:=y1+30;
           kx1:=210; ky1:=220;  kx2:=330; ky2:=180;  kx3:=450; ky3:=220;
           kx4:=210; ky4:=340;  kx5:=330; ky5:=340;  kx6:=450; ky6:=340;

           kasa_oynat;
           lever_ata:=5;
           if mo_button=0 then
              begin
                   butonlari_pasifyap;
                   butonlari_dose;
              end;
           oyun_aktif:=true;
           sizin_tasima:=0;
           puan;
        end;
   end;

if (mo_x>382) and (mo_x<444)and (mo_y>6) and (mo_y<48) then
   begin
        if mo_button=0 then begin
           setfillstyle(1,BLACK); bar(111,90,580,470);
           lever7;
           x1:=223;  y1:=245;  x2:=x1+30; y2:=y1+30;
           kx1:=300; ky1:=201;  kx2:=340; ky2:=201;  kx3:=380; ky3:=201;
           kx4:=300; ky4:=241;  kx5:=260; ky5:=281;

           kasa_oynat;
           lever_ata:=6;
           if mo_button=0 then
              begin
                   butonlari_pasifyap;
                   butonlari_dose;
              end;
           oyun_aktif:=true;
           sizin_tasima:=0;
           puan;
        end;
   end;

if (mo_x>445) and (mo_x<507)and (mo_y>6) and (mo_y<48) then
   begin
        if mo_button=0 then begin
           setfillstyle(1,BLACK); bar(111,90,580,470);
           lever8;
           x1:=452;  y1:=285;  x2:=x1+30; y2:=y1+30;
           kx1:=210; ky1:=200;  kx2:=250; ky2:=240;  kx3:=450; ky3:=200;
           kx4:=490; ky4:=240;
           kasa_oynat;
           lever_ata:=7;
           if mo_button=0 then
              begin
                   butonlari_pasifyap;
                   butonlari_dose;
              end;
           oyun_aktif:=true;
           sizin_tasima:=0;
           puan;
        end;
   end;

if (mo_x>508) and (mo_x<570)and (mo_y>6) and (mo_y<48) then
   begin
        if mo_button=0 then begin
           setfillstyle(1,BLACK); bar(111,90,580,470);
           lever9;
           x1:=422;  y1:=285;  x2:=x1+30; y2:=y1+30;
           kx1:=300; ky1:=200;  kx2:=340; ky2:=240;
           kx3:=340; ky3:=280;  kx4:=380; ky4:=280;

           kasa_oynat;
           lever_ata:=8;
           if mo_button=0 then
              begin
                   butonlari_pasifyap;
                   butonlari_dose;
              end;
           oyun_aktif:=true;
           sizin_tasima:=0;
           puan;
        end;
   end;

if (mo_x>571) and (mo_x<632)and (mo_y>6) and (mo_y<48) then
   begin
        if mo_button=0 then begin
           setfillstyle(1,BLACK); bar(111,90,580,470);

           lever10;
           x1:=302;  y1:=335;  x2:=x1+30; y2:=y1+30;
           kx1:=340; ky1:=210;  kx2:=300; ky2:=250;
           kx3:=340; ky3:=290;  kx4:=380; ky4:=290;
           kasa_oynat;
           lever_ata:=9;
           if mo_button=0 then
              begin
                   butonlari_pasifyap;
                   butonlari_dose;
              end;
           oyun_aktif:=true;
           sizin_tasima:=0;
           puan;
        end;
   end;
end;
{ program&#141;n her hangi bir an&#141;nda esc ile c&#141;k&#141;ss&#141; saglar }
if keypressed then
   begin
        tus:=readkey;
        if tus=#27 then halt;
   end;

until oyun_aktif=true;


{///////////////////////////////////////////////////////////////////////////}

{ LEE NIN BIR TUSA BASILANA KADAR OYNAMASI  }
repeat
      repeat
            lever_goster;
            getmousecoords(m_x,m_y,m_button);
            if (mo_x<>m_x) or (mo_y<>m_y) or (mo_button<>m_button) then
               begin
                    mo_x:=m_x; mo_y:=m_y; mo_button:=m_button;
               end;
            if (mo_x>x1-5) and (mo_x<x1+35) and (mo_y>y1-5) and (mo_y<y1+35) then
               mousesakla else mousegoster;
            setfillstyle(1,BLACK);
            bar(x1+2,y1-3,x1+30,y1+33);
            dur:=0;
            setcolor(yellow);
            repeat
                  inc(dur);
                  for a:=0 to 39 do
                     begin
                         if (lee_geri[a,2]=0) and (lee_geri[a,2]=0) then
                            moveto(x1+lee_geri[a,0],lee_geri[a,1]+y1-4)
                            else
                              lineto(x1+lee_geri[a,0],lee_geri[a,1]+y1-4);
                         if (lee_geri[a,2]=0) and (lee_geri[a,3]=1) and (lee_geri[a,4]=0) then
                            circle(x1+lee_geri[a,0],lee_geri[a,1]+y1-4,10)
                            else
                            if (lee_geri[a,2]=0) and (lee_geri[a,3]=1) and (lee_geri[a,4]=1) then
                               circle(x1+lee_geri[a,0],lee_geri[a,1]+y1-4,3)
                     end;

            until (dur=250) or (keypressed);
            if keypressed then
               begin
                    tus:=readkey;
                    if (tus=#75) or (tus=#77) or (tus=#80) or (tus=#72) then
                       goto devam_lever;
                    if tus=#13 then goto tekrar_basla;
                    if tus=#27 then halt;
               end;

            getmousecoords(m_x,m_y,m_button);
            if (mo_x<>m_x) or (mo_y<>m_y) or (mo_button<>m_button) then
               begin
                    mo_x:=m_x;
                    mo_y:=m_y;
                    mo_button:=m_button;
               end;
            if (mo_x>x1-5) and (mo_x<x1+35) and (mo_y>y1-5) and (mo_y<y1+35) then
                mousesakla
                else
                    mousegoster;

            setfillstyle(1,BLACK); bar(x1+2,y1-3,x1+30,y1+33);
            dur:=0;       setcolor(yellow);
            repeat
                  inc(dur);
                  for a:=0 to 41 do
                     begin
                      if (lee_ileri[a,2]=0) and (lee_ileri[a,2]=0) then
                         moveto(x1+lee_ileri[a,0],lee_ileri[a,1]+y1-4)
                         else
                         lineto(x1+lee_ileri[a,0],lee_ileri[a,1]+y1-4);

                      if (lee_ileri[a,2]=0) and (lee_ileri[a,3]=1) and (lee_ileri[a,4]=0) then
                         circle(x1+lee_ileri[a,0],lee_ileri[a,1]+y1-4,10)
                         else
                         if (lee_ileri[a,2]=0) and (lee_ileri[a,3]=1) and (lee_ileri[a,4]=1) then
                            circle(x1+lee_ileri[a,0],lee_ileri[a,1]+y1-4,3);
                     end;
            until (dur=250) or (keypressed);
      if keypressed then
        begin
         tus:=readkey;
         if (tus=#75) or (tus=#77) or (tus=#80) or (tus=#72) then goto devam_lever;
         if tus=#13 then goto tekrar_basla;
         if tus=#27 then halt;
        end;

       until keypressed;


       tus:=readkey;
       devam_lever:
       if tus=#13 then oyun_aktif:=false;

       setfillstyle(1,BLACK);
       bar(x1+2,y1-3,x1+34,y1+33);

{ LEE NIN SOL A GITMASI  }

if tus=#75 then
   begin

   if (getpixel((x1-7),y1+1)=7) and (getpixel((x1-7)-40,y1+1)=BLACK) then
      begin
           inc(sizin_tasima);
           puan;
           cal:=true;
           le_gr_dn[0]:=x1; le_gr_dn[1]:=y1; le_gr_dn[2]:=1;
           if ((x1-7)-40+10>kx1)and((x1-7)-40-10<kx1)and((y1+1)+10>ky1)and((y1+1)-10<ky1) then
              begin
                   ks_gr_dn[0]:=kx1;
                   ks_gr_dn[1]:=ky1;
                   ks_gr_dn[2]:=1;
                   ks_gr_dn[3]:=1;
                   kx1:=kx1-40;
                   x1:=x1-40;
                   setfillstyle(1,BLACK);
                   bar(x1-1,y1-3,x1+36,y1+34);
              end;
           if ((x1-7)-40+10>kx2)and((x1-7)-40-10<kx2)and((y1+1)+10>ky2)and((y1+1)-10<ky2) then
              begin
                   ks_gr_dn[0]:=kx2;
                   ks_gr_dn[1]:=ky2;
                   ks_gr_dn[2]:=2;
                   ks_gr_dn[3]:=1;
                   kx2:=kx2-40;
                   x1:=x1-40;
                   setfillstyle(1,BLACK);
                   bar(x1-1,y1-3,x1+36,y1+34);
              end;
           if ((x1-7)-40+10>kx3)and((x1-7)-40-10<kx3)and((y1+1)+10>ky3)and((y1+1)-10<ky3) then
              begin
                   ks_gr_dn[0]:=kx3;
                   ks_gr_dn[1]:=ky3;
                   ks_gr_dn[2]:=3;
                   ks_gr_dn[3]:=1;
                   kx3:=kx3-40;
                   x1:=x1-40;
                   setfillstyle(1,BLACK);
                   bar(x1-1,y1-3,x1+36,y1+34);
              end;
           if ((x1-7)-40+10>kx4)and((x1-7)-40-10<kx4)and((y1+1)+10>ky4)and((y1+1)-10<ky4) then
              begin
                   ks_gr_dn[0]:=kx4;
                   ks_gr_dn[1]:=ky4;
                   ks_gr_dn[2]:=4;
                   ks_gr_dn[3]:=1;
                   kx4:=kx4-40;
                   x1:=x1-40;
                   setfillstyle(1,BLACK);
                   bar(x1-1,y1-3,x1+36,y1+34);
              end;
           if ((x1-7)-40+10>kx5)and((x1-7)-40-10<kx5)and((y1+1)+10>ky5)and((y1+1)-10<ky5) then
              begin
                   ks_gr_dn[0]:=kx5;
                   ks_gr_dn[1]:=ky5;
                   ks_gr_dn[2]:=5;
                   ks_gr_dn[3]:=1;
                   kx5:=kx5-40;
                   x1:=x1-40;
                   setfillstyle(1,BLACK);
                   bar(x1-1,y1-3,x1+36,y1+34);
              end;
           if ((x1-7)-40+10>kx6)and((x1-7)-40-10<kx6)and((y1+1)+10>ky6)and((y1+1)-10<ky6) then
              begin
                   ks_gr_dn[0]:=kx6;
                   ks_gr_dn[1]:=ky6;
                   ks_gr_dn[2]:=6;
                   ks_gr_dn[3]:=1;
                   kx6:=kx6-40;
                   x1:=x1-40;
                   setfillstyle(1,BLACK);
                   bar(x1-1,y1-3,x1+36,y1+34);
                   if  getpixel(kx6+14,y1+14)=7 then
                       kx6_boya:=true;
              end;
      end;
   kasa_oynat;
   if (getpixel((x1-7),y1+1)=BLACK) then
      x1:=x1-40;

end;

{ LEE NIN SAG A GITMASI  }

if tus=#77 then
   begin

   if (getpixel((x1+36)+8,y1+1)=7) and (getpixel((x1+36)+48,y1+1)=BLACK) then
      begin
           inc(sizin_tasima);
           puan; cal:=true;
           le_gr_dn[0]:=x1;
           le_gr_dn[1]:=y1;
           le_gr_dn[2]:=1;
           if ((x1+36)+3+10>kx1)and((x1+36)+3-10<kx1)and((y1-1)+10>ky1)and((y1+1)-10<ky1) then
              begin
                   ks_gr_dn[0]:=kx1;
                   ks_gr_dn[1]:=ky1;
                   ks_gr_dn[2]:=1;
                   ks_gr_dn[3]:=1;
                   kx1:=kx1+40;
                   x1:=x1+40;
                   setfillstyle(1,BLACK);
                   bar(x1-1,y1-3,x1+36,y1+34);
              end;
           if ((x1+36)+3+10>kx2)and((x1+36)+3-10<kx2)and((y1-1)+10>ky2)and((y1+1)-10<ky2) then
              begin
                   ks_gr_dn[0]:=kx2;
                   ks_gr_dn[1]:=ky2;
                   ks_gr_dn[2]:=2;
                   ks_gr_dn[3]:=1;
                   kx2:=kx2+40;
                   x1:=x1+40;
                   setfillstyle(1,BLACK);
                   bar(x1-1,y1-3,x1+36,y1+34);
              end;
           if ((x1+36)+3+10>kx3)and((x1+36)+3-10<kx3)and((y1-1)+10>ky3)and((y1+1)-10<ky3) then
              begin
                   ks_gr_dn[0]:=kx3;
                   ks_gr_dn[1]:=ky3;
                   ks_gr_dn[2]:=3;
                   ks_gr_dn[3]:=1;
                   kx3:=kx3+40;
                   x1:=x1+40;
                   setfillstyle(1,BLACK);
                   bar(x1-1,y1-3,x1+36,y1+34);
              end;
           if ((x1+36)+3+10>kx4)and((x1+36)+3-10<kx4)and((y1-1)+10>ky4)and((y1+1)-10<ky4) then
              begin
                   ks_gr_dn[0]:=kx4;
                   ks_gr_dn[1]:=ky4;
                   ks_gr_dn[2]:=4;
                   ks_gr_dn[3]:=1;
                   kx4:=kx4+40;
                   x1:=x1+40;
                   setfillstyle(1,BLACK);
                   bar(x1-1,y1-3,x1+36,y1+34);
              end;
           if ((x1+36)+3+10>kx5)and((x1+36)+3-10<kx5)and((y1-1)+10>ky5)and((y1+1)-10<ky5) then
              begin
                   ks_gr_dn[0]:=kx5;
                   ks_gr_dn[1]:=ky5;
                   ks_gr_dn[2]:=5;
                   ks_gr_dn[3]:=1;
                   kx5:=kx5+40;
                   x1:=x1+40;
                   setfillstyle(1,BLACK);
                   bar(x1-1,y1-3,x1+36,y1+34);
              end;
           if ((x1+36)+3+10>kx6)and((x1+36)+3-10<kx6)and((y1-1)+10>ky6)and((y1+1)-10<ky6) then
              begin
                   ks_gr_dn[0]:=kx6;
                   ks_gr_dn[1]:=ky6;
                   ks_gr_dn[2]:=6;
                   ks_gr_dn[3]:=1;
                   kx6:=kx6+40;
                   x1:=x1+40;
                   setfillstyle(1,BLACK);
                   bar(x1-1,y1-3,x1+36,y1+34);
              end;
      end;
   kasa_oynat;
   if (getpixel((x1+36)+8,y1+1)=BLACK) then
      x1:=x1+40;

end;

{  LEE NIN UST E GITMASI  }
if tus=#72 then
   begin
        setcolor(red);
        if (getpixel(x1+3,(y1-3)-8)=7) and (getpixel((x1+3),(y1-3)-48)=BLACK) then
           begin
                inc(sizin_tasima);
                puan;
                cal:=true;
                le_gr_dn[0]:=x1;
                le_gr_dn[1]:=y1;
                le_gr_dn[2]:=1;
                if ((x1+3)+10>kx1)and((x1+3)-10<kx1)and((y1-3)-40+10>ky1)and((y1-3)-40-10<ky1) then
                   begin
                        ks_gr_dn[0]:=kx1;
                        ks_gr_dn[1]:=ky1;
                        ks_gr_dn[2]:=1;
                        ks_gr_dn[3]:=1;
                        ky1:=ky1-40;
                        y1:=y1-40;
                        setfillstyle(1,BLACK);
                        bar(x1-1,y1-3,x1+36,y1+34);
                   end;
                if ((x1+3)+10>kx2)and((x1+3)-10<kx2)and((y1-3)-40+10>ky2)and((y1-3)-40-10<ky2) then
                   begin
                        ks_gr_dn[0]:=kx2;
                        ks_gr_dn[1]:=ky2;
                        ks_gr_dn[2]:=2;
                        ks_gr_dn[3]:=1;
                        ky2:=ky2-40;
                        y1:=y1-40;
                        setfillstyle(1,BLACK);
                        bar(x1-1,y1-3,x1+36,y1+34);
                   end;
                if ((x1+3)+10>kx3)and((x1+3)-10<kx3)and((y1-3)-40+10>ky3)and((y1-3)-40-10<ky3) then
                   begin
                        ks_gr_dn[0]:=kx3;
                        ks_gr_dn[1]:=ky3;
                        ks_gr_dn[2]:=3;
                        ks_gr_dn[3]:=1;
                        ky3:=ky3-40;
                        y1:=y1-40;
                        setfillstyle(1,BLACK);
                        bar(x1-1,y1-3,x1+36,y1+34);
                   end;
                if ((x1+3)+10>kx4)and((x1+3)-10<kx4)and((y1-3)-40+10>ky4)and((y1-3)-40-10<ky4) then
                   begin
                        ks_gr_dn[0]:=kx4;
                        ks_gr_dn[1]:=ky4;
                        ks_gr_dn[2]:=4;
                        ks_gr_dn[3]:=1;
                        ky4:=ky4-40;
                        y1:=y1-40;
                        setfillstyle(1,BLACK);
                        bar(x1-1,y1-3,x1+36,y1+34);
                   end;
                if ((x1+3)+10>kx5)and((x1+3)-10<kx5)and((y1-3)-40+10>ky5)and((y1-3)-40-10<ky5) then
                   begin
                        ks_gr_dn[0]:=kx5;
                        ks_gr_dn[1]:=ky5;
                        ks_gr_dn[2]:=5;
                        ks_gr_dn[3]:=1;
                        ky5:=ky5-40;
                        y1:=y1-40;
                        setfillstyle(1,BLACK);
                        bar(x1-1,y1-3,x1+36,y1+34);
                   end;
                if ((x1+3)+10>kx6)and((x1+3)-10<kx6)and((y1-3)-40+10>ky6)and((y1-3)-40-10<ky6) then
                   begin
                        ks_gr_dn[0]:=kx6;
                        ks_gr_dn[1]:=ky6;
                        ks_gr_dn[2]:=6;
                        ks_gr_dn[3]:=1;
                        ky6:=ky6-40;
                        y1:=y1-40;
                        setfillstyle(1,BLACK);
                        bar(x1-1,y1-3,x1+36,y1+34);
                   end;

           end;
        kasa_oynat;

        if (getpixel(x1+3,(y1-3)-8)=BLACK) then
           y1:=y1-40;
   end;
{  LEE NIN ALT A GITMASI  }
if tus=#80 then
   begin

        if (getpixel(x1+4,(y1-3)+44)=7) and (getpixel((x1+4),(y1-3)+84)=BLACK) then
           begin
                inc(sizin_tasima);
                puan;
                cal:=true;
                le_gr_dn[0]:=x1;
                le_gr_dn[1]:=y1;
                le_gr_dn[2]:=1;
                if ((x1+4)+10>kx1)and((x1+4)-10<kx1)and((y1-4)+40+10>ky1)and((y1-4)+40-10<ky1) then
                   begin
                        ks_gr_dn[0]:=kx1;
                        ks_gr_dn[1]:=ky1;
                        ks_gr_dn[2]:=1;
                        ks_gr_dn[3]:=1;
                        ky1:=ky1+40;
                        y1:=y1+40;
                        setfillstyle(1,BLACK);
                        bar(x1-1,y1-3,x1+36,y1+34);
                   end;
                if ((x1+4)+10>kx2)and((x1+4)-10<kx2)and((y1-4)+40+10>ky2)and((y1-4)+40-10<ky2) then
                   begin
                        ks_gr_dn[0]:=kx2;
                        ks_gr_dn[1]:=ky2;
                        ks_gr_dn[2]:=2;
                        ks_gr_dn[3]:=1;
                        ky2:=ky2+40;
                        y1:=y1+40;
                        setfillstyle(1,BLACK);
                        bar(x1-1,y1-3,x1+36,y1+34);
                   end;
                if ((x1+4)+10>kx3)and((x1+4)-10<kx3)and((y1-4)+40+10>ky3)and((y1-4)+40-10<ky3) then
                   begin
                        ks_gr_dn[0]:=kx3;
                        ks_gr_dn[1]:=ky3;
                        ks_gr_dn[2]:=3;
                        ks_gr_dn[3]:=1;
                        ky3:=ky3+40;
                        y1:=y1+40;
                        setfillstyle(1,BLACK);
                        bar(x1-1,y1-3,x1+36,y1+34);
                   end;
                if ((x1+4)+10>kx4)and((x1+4)-10<kx4)and((y1-4)+40+10>ky4)and((y1-4)+40-10<ky4) then
                   begin
                        ks_gr_dn[0]:=kx4;
                        ks_gr_dn[1]:=ky4;
                        ks_gr_dn[2]:=4;
                        ks_gr_dn[3]:=1;
                        ky4:=ky4+40;
                        y1:=y1+40;
                        setfillstyle(1,BLACK);
                        bar(x1-1,y1-3,x1+36,y1+34);
                   end;
                if ((x1+4)+10>kx5)and((x1+4)-10<kx5)and((y1-4)+40+10>ky5)and((y1-4)+40-10<ky5) then
                   begin
                        ks_gr_dn[0]:=kx5;
                        ks_gr_dn[1]:=ky5;
                        ks_gr_dn[2]:=5;
                        ks_gr_dn[3]:=1;
                        ky5:=ky5+40;
                        y1:=y1+40;
                        setfillstyle(1,BLACK);
                        bar(x1-1,y1-3,x1+36,y1+34);
                   end;
                if ((x1+4)+10>kx6)and((x1+4)-10<kx6)and((y1-4)+40+10>ky6)and((y1-4)+40-10<ky6) then
                   begin
                        ks_gr_dn[0]:=kx6;
                        ks_gr_dn[1]:=ky6;
                        ks_gr_dn[2]:=6;
                        ks_gr_dn[3]:=1;
                        ky6:=ky6+40;
                        y1:=y1+40;
                        setfillstyle(1,BLACK);
                        bar(x1-1,y1-3,x1+36,y1+34);
                   end;

           end;
        kasa_oynat;
        if (getpixel(x1+4,(y1-4)+44)=BLACK) then
           y1:=y1+40;
   end;

if tus=#79 then
   begin

   if (ks_gr_dn[2]=1) and (ks_gr_dn[3]=1)then
      begin
           setfillstyle(1,black);
           bar(kx1,ky1,kx1+40,ky1+40);
           kx1:=ks_gr_dn[0];
           ky1:=ks_gr_dn[1];
           x1:=le_gr_dn[0];
           y1:=le_gr_dn[1];
           dec(sizin_tasima);
           kasa_oynat;
           puan;
           ks_gr_dn[3]:=0;
      end;
   if (ks_gr_dn[2]=2) and (ks_gr_dn[3]=1) then
      begin
           setfillstyle(1,black);
           bar(kx2,ky2,kx2+40,ky2+40);
           kx2:=ks_gr_dn[0];
           ky2:=ks_gr_dn[1];
           x1:=le_gr_dn[0];
           y1:=le_gr_dn[1];
           dec(sizin_tasima);
           kasa_oynat;
           puan;
           ks_gr_dn[3]:=0;
      end;
   if (ks_gr_dn[2]=3) and (ks_gr_dn[3]=1) then
      begin
           setfillstyle(1,black);
           bar(kx3,ky3,kx3+40,ky3+40);
           kx3:=ks_gr_dn[0];
           ky3:=ks_gr_dn[1];
           x1:=le_gr_dn[0];
           y1:=le_gr_dn[1];
           dec(sizin_tasima);
           kasa_oynat;
           puan;
           ks_gr_dn[3]:=0;
      end;
   if (ks_gr_dn[2]=4) and (ks_gr_dn[3]=1) then
      begin
           setfillstyle(1,black);
           bar(kx4,ky4,kx4+40,ky4+40);
           kx4:=ks_gr_dn[0];
           ky4:=ks_gr_dn[1];
           x1:=le_gr_dn[0];
           y1:=le_gr_dn[1];
           dec(sizin_tasima);
           kasa_oynat;
           puan;
           ks_gr_dn[3]:=0;
      end;
   if (ks_gr_dn[2]=5) and (ks_gr_dn[3]=1) then
      begin
           setfillstyle(1,black);
           bar(kx5,ky5,kx5+40,ky5+40);
           kx5:=ks_gr_dn[0];
           ky5:=ks_gr_dn[1];
           x1:=le_gr_dn[0];
           y1:=le_gr_dn[1];
           dec(sizin_tasima);
           kasa_oynat;
           puan;
           ks_gr_dn[3]:=0;
      end;
   if (ks_gr_dn[2]=6) and (ks_gr_dn[3]=1) then
      begin
           setfillstyle(1,black);
           bar(kx6,ky6,kx6+40,ky6+40);
           kx6:=ks_gr_dn[0];
           ky6:=ks_gr_dn[1];
           x1:=le_gr_dn[0];
           y1:=le_gr_dn[1];
           dec(sizin_tasima);
           kasa_oynat;
           puan;
           ks_gr_dn[3]:=0;
      end;

   kasa_oynat;
end;

if tus=#13 then
   begin
        lever_ata:=15;
        goto tekrar_basla;
   end;

until tus=#27;

mousesakla;
closegraph;
end.


kadir göksu
0537 7145725


Yorumlar                 Yorum Yaz
Bu hazır kod'a ilk yorumu siz yapın!
KATEGORİLER
ASP - 240
ASP.NET - 24
C# - 75
C++ - 174
CGI - 8
DELPHI - 247
FLASH - 49
HTML - 536
PASCAL - 246
PERL - 11
PHP - 160
WML - 9
XML - 2
Copyright © 2002 - 2024 Hazır Kod - Tüm Hakları Saklıdır.
Siteden yararlanırken gizlilik ilkelerini okumanızı tavsiye ederiz.
hazirkod.com bir İSOBİL projesidir.