The following code has two random functions that don't pick random. THEY ALLWAYS PICK 0!!!!can anyone help me???

<near the bottem>



#include <iostream.h>
#include <conio.h>
#include <stdlib.h>
int main()
{
clrscr();
int tries;
int x;
int y;
int a = 0;
int b = 0;
int plyrs;
cout<<"how many players?<2 for 2 and anything for 1>"<<endl;
cin>>plyrs;
if (plyrs==2)
{
cout<<"please enter amount o' tries: "<<endl;
cin>>tries;
clrscr();
cout<<"hider, type coordinates of hidden character:<has to be under 10,10 please."<<endl;
cin>>x>>y;
clrscr();
cout<<"seeker, you are at coordinates 0,0. you will have to find the hidden character in 15 tries. move up down left and right. good luck."<<endl;
getch();
clrscr;
{
int c = 0;
while(c==0)
{
if (tries>0)
{
if (b==x&&a==y)
{
cout<<"congratulations!you've found the hidden item!!!!"<<endl;
getch();
return 0;
}
else
{
clrscr();
cout<<"coordinates="<<b<<", "<<a<<endl;
cout<<"you have "<<tries<<"tries left."<<endl;
gotoxy(b, a);
char cl = getch();
if (cl==72)
{
gotoxy(b, a);
putch('$');
gotoxy(b, a++);
tries=tries-1;
}
if (cl==104)
{
if (tries<=10)
{
cout<<"first coordinate is: "<<x<<endl;
getch();
}
}
if (cl==80)
{
gotoxy(b, a);
putch('$');
gotoxy(b, a--);
tries=tries-1;
}
if (cl==63)
{
cout<<"its not nice to cheat but, oh well. the coordinates are: "<<x<<", "<<y<<endl;
getch();
}
if (cl==77)
{
gotoxy(b, a);
putch('$');
gotoxy(b--, a);
tries=tries-1;
}
if (cl==75)
{
gotoxy(b, a);
putch('$');
gotoxy(b++, a);
tries=tries-1;
}
if (cl==27)
{
getch();
return 0;
}
}
}
else
{
cout<<"im sorry but you ran out of tries!!!"<<endl;
getch();
return 0;
}
}
}
return 0;
}
else
{
cout<<"ok, computer. the computer will now detirmine the coordinates...."<<endl;
int x = rand()%16;//RANDOM OUT OF 15!!!!
int y = rand()%16;//RANDOM OUT OF 15!!!
cout<<"the coordinates are out of 15."<<endl;
clrscr();
cout<<"how many tries?"<<endl;
cin>>tries;
clrscr();
{
cout<<"you have "<<tries<<" tries to guess the coordinates."<<endl;
cout<<"your coordinates are: "<<a<<", "<<b<<endl;
if (tries>0)
{
int d =5;
while(d==5)
{
if (b!=x, a!=y)
{
char cl = getch();
if (cl==72)
{
gotoxy(b, a);
gotoxy(b, a++);
tries=tries-1;
}
if (cl==80)
{
gotoxy(b, a);
gotoxy(b, a--);
tries=tries-1;
}
if (cl==75)
{
gotoxy(b, a);
gotoxy(b--, a);
tries=tries-1;
}
if (cl==77)
{
gotoxy(b, a);
gotoxy(b++, a);
tries=tries-1;
}
if (cl==104)
{
if (tries<=10)
{
cout<<"the hint is: "<<x<<" is the first coordinet"<<endl;
}
}
else
{
cout<<"congratulations!!! you found the right coordinates!!"<<endl;
}
}
}
}
else
{
cout<<"sorry, but tries ran out!!"<<endl;
}
}
}
return 0;
}


Please help me if you can!!!