HACK TÜRKS
Would you like to react to this message? Create an account in a few clicks or log in to continue.

HACK TÜRKS


 
Yılan oyunu(c++) Hosgeldnztu9AnasayfaLatest imagesAramaKayıt OlGiriş yapYılan oyunu(c++) Hosgeldnztu9

 

 Yılan oyunu(c++)

Aşağa gitmek 
YazarMesaj
Admin [TEZOoO]
ADMİN - YÖNETİCİ
ADMİN - YÖNETİCİ
Admin [TEZOoO]


Mesaj Sayısı : 380
NERDEN : İstanbul/Sefaköy
Kayıt tarihi : 14/09/08

Kişi sayfası
Rep Puanı:
Yılan oyunu(c++) Left_bar_bleue50000000/0Yılan oyunu(c++) Empty_bar_bleue  (50000000/0)

Yılan oyunu(c++) Empty
MesajKonu: Yılan oyunu(c++)   Yılan oyunu(c++) EmptySalı Eyl. 16, 2008 10:30 am

# 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,Cool; 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("PAYLASTR 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;i{
gotoxy(yilan[i][0],yilan[i][1]); cprintf("");
}
textcolor(2); gotoxy(yemx,yemy); cprintf("*");
gotoxy(yilan[yb-1][0],yilan[yb-1][1]); printf(" ");
}

yem()
{
randomize();
j=0;
while(j==0)
{
yemx=(rand()%67)+6;
yemy=(rand()%17)+3;
for (i=0;i{
if (yemx!=yilan[i][0] && yemy!=yilan[i][1])
j=1;
textcolor(2); gotoxy(yemx,yemy); cprintf("*");
}
}
}


yilanciz()
{
textcolor(7);
for (i=0;i{
gotoxy(yilan[i][0],yilan[i][1]); printf("");
}
gotoxy((yilan[yb-1][0]),(yilan[yb-1][1])); printf(" ");

if (yilan[0][0]==yemx && yilan[0][1]==yemy)
{
yb=yb+1;
toppuan=toppuan+puan;
gotoxy(30,24); printf("PUAN...: %d ",toppuan);
gotoxy((yilan[yb-1][0]),(yilan[yb-1][1])); printf("");
gotoxy(30,24); printf("PUAN...: %d ",toppuan);
yem();
}
if (yilan[0][1]==2 || yilan[0][1]==22 || yilan[0][0]==5 || yilan[0][0]==75)
{
gotoxy(30,25); printf("Oyun Bitti!"); durum=1;
return 0;
}

for (i=1;i{
if(yilan[0][0]==yilan[i][0] && yilan[0][1]==yilan[i][1])
{
gotoxy(30,25); printf("Oyun Bitti!"); durum =1; return 0;
}
}
}


main()
{
acilis();
tus=getch();
while(tus!=27)
{
while(!kbhit() && durum==0)
{
if(tus==77) //sag
{
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 (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();
}
Sayfa başına dön Aşağa gitmek
https://hackturks.yetkin-forum.com
 
Yılan oyunu(c++)
Sayfa başına dön 
1 sayfadaki 1 sayfası
 Similar topics
-

Bu forumun müsaadesi var:Bu forumdaki mesajlara cevap veremezsiniz
HACK TÜRKS :: Programlama :: C/C++-
Buraya geçin:  
SİTENİ REKLAM VER (BEDAVA)
HACK TÜRKS
Siteni Ekle
Siteni Ekle
Siteni Ekle
Siteni Ekle
Siteni Ekle
Siteni Ekle
Siteni Ekle
Siteni Ekle

BÜYÜK YERİMİZ..!!!
forum kurmak | ©phpBB | Bedava yardımlaşma forumu | Suistimalı göstermek | Son tartışmalar