mirror of
https://github.com/TheAlgorithms/C
synced 2024-11-24 14:29:42 +03:00
Update : common if
This commit is contained in:
parent
f47b18cf6d
commit
5bf3c34f51
@ -29,7 +29,7 @@ int validEntryLineColumn(int line, char column)
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0 ;
|
||||
return 0;
|
||||
}
|
||||
/**
|
||||
* @brief Function validatePosition
|
||||
@ -46,17 +46,8 @@ int validatePosition(int mat[10][10], int boat, int line, int column,
|
||||
int cont = 0;
|
||||
int i, j;
|
||||
|
||||
if (boat < 1 || boat > 3)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (guide != 'H' && guide != 'V')
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ((line < 0 || line > 9) || (column < 0 || column > 9))
|
||||
if (line < 0 || line > 9 || column < 0 || column > 9 ||
|
||||
(guide != 'H' && guide != 'V') || boat < 1 || boat > 3)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@ -102,10 +93,7 @@ int validatePosition(int mat[10][10], int boat, int line, int column,
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
/**
|
||||
* @brief Function canShoot
|
||||
|
Loading…
Reference in New Issue
Block a user