# include
# include
# include
# include
# include
int yilan[100][2];
int yemx,yemy,yb;
int tus;
int i,j;
int puan,hiz,toppuan;
int secim;
int durum=0;
acilis()
{
clrscr();
textcolor(4);
gotoxy(23,5); cprintf("Ú");
gotoxy(51,5); cprintf("¿");
gotoxy(23,16); cprintf("À");
gotoxy(51,16); cprintf("Ù");
textcolor(10); gotoxy(26,8); cprintf("[1] Yavas Puan(5)");
textcolor(10); gotoxy(26,9); cprintf("[2] Normal Puan(10)");
textcolor(10); gotoxy(26,10); cprintf("[3] Hizli Puan(15)");
textcolor(10); gotoxy(26,11); cprintf("[4] Cok Hizli Puan(20)");
textcolor(10); gotoxy(26,12); cprintf("[5] Cikis");
textcolor(2); gotoxy(26,14); cprintf("Seciminiz...: ");
textcolor(7);
secim=getch();
switch(secim)
{
case '1': puan=5; hiz=200; break;
case '2': puan=10; hiz=150; break;
case '3': puan=15; hiz=100; break;
case '4': puan=20; hiz=50; break;
case '5': return 0; break;
default : puan=5; hiz=200; break;
}
clrscr();
textcolor(9); gotoxy(30,1); cprintf("441 EMRAH SIMSEK YILAN OYUNU");
textcolor(4);
gotoxy(5,2); cprintf("Ú");
gotoxy(75,2); cprintf("¿");
gotoxy(5,22); cprintf("À");
gotoxy(75,22); cprintf("Ù");
textcolor(7);
for (i=6;i<=74;i++)
{
gotoxy(i,2); cprintf("Ä");
gotoxy(i,22); cprintf("Ä");
}
for (i=3;i<=21;i++)
{
gotoxy(5,i);cprintf("³");
gotoxy(75,i);cprintf("³");
}
yb=3;
yilan[0][0]=10;
yilan[1][0]=9;
yilan[2][0]=8;
yilan[0][1]=10;
yilan[1][1]=10;
yilan[2][1]=10;
randomize();
yemx=(rand()%50)+5;
yemy=(rand()%10)+5;
textcolor(7);
for (i=0;i0;i--)
{
yilan[i][0]=yilan[i-1][0];
yilan[i][1]=yilan[i-1][1];
}
yilan[0][0]=yilan[0][0]+1;
yilanciz();
}
if (tus==80) //asagi
{
for (i=yb-1;i>0;i--)
{
yilan[i][0]=yilan[i-1][0];
yilan[i][1]=yilan[i-1][1];
}
yilan[0][1]=yilan[0][1]+1;
yilanciz();
}
if (tus==72) //yukari
{
for (i=yb-1;i>0;i--)
{
yilan[i][0]=yilan[i-1][0];
yilan[i][1]=yilan[i-1][1];
}
yilan[0][1]=yilan[0][1]-1;
yilanciz();
}
if (tus==75) //sol
{
for (i=yb-1;i>0;i--)
{
yilan[i][0]=yilan[i-1][0];
yilan[i][1]=yilan[i-1][1];
}
yilan[0][0]=yilan[0][0]-1;
yilanciz();
}
if (durum==1)
{
getch();
return 0;
}
delay(hiz);
}
tus=getch();
}
getch();
}
|