1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
{
int PlaceIt;
int row,col;
int r[5]={4,3,2,1,0};
char place[2];
SetConsoleTextAttribute (console, 62);
do{
col=0;
row=0;
do
{
gotoXY(23,28,"Place at ?(A1...E5)?: \b\b\b");
cin >> place;
} while (toupper(place[0])<'A'||toupper(place[0])>'E'|| place[1]<'1' || place[1]>'5');
col = (toupper(place[0])-64);
row = r[(place[1]-49)];
PlaceIt = (col+(5*row));
if ( b[PlaceIt]==1)
{
gotoXY(23,28,"You're using that space.");
Sleep(1500);
}
if ( b[PlaceIt]==2)
{
gotoXY(23,28,"Sorry, that space taken.");
Sleep(1500);
}
if ( b[PlaceIt]==0)
{
gotoXY(23,28,"Inserting your checker. ");
Sleep(1500);
}
} while (PlaceIt <1 || PlaceIt >25 || b[PlaceIt]!=0 );
b[PlaceIt]=1;
}
|