So I have to wirte a checker game that has one of the functions that checks a checker's position on the board. I have to follow these guidelines
Your function CheckList has the prototype
bool CheckList( int inArray1[], int inArray2[], int xIndex, int yIndex);
Your function CheckList uses the pair of arrays. The pair of arrays inArray1[] and inArray2[] contain the x and y indices of some of one player’s checkers. The array inArray1[] contains the x indices and the array inArray2[] contains the y indices. The pair of arrays used as actual parameters when your program calls CheckList will be the arrays generated by CountJumps of the arrays generated by CountMove1Squares.
Your function CheckList also uses parameters xIndex and yIndex, the x and y indices of a particular checker.
Your function CheckList determines if the checker at (xIndex, yIndex) on the board is in the list of checkers described in the arrays inArray1[] and inArray2[].
a. If the checker at (xIndex, yIndex) is in the list the function returns true
b. Otherwise the function returns false
So far my code is as follows:
1 2 3 4 5 6 7 8 9 10 11 12
|
bool CheckList(int inArray1[], int inArray2[], int xIndex, int yIndex)
{
if (0 < xIndex < inArray1 && 0 < yIndex < inArray2)
{
return true;
}
else
{
return false;
}
}
|
Im getting an error that the x/yindex are incompatible with the inArray1&2. it says that operand types are incompatible ("bool" and "int*")
Thanks in advance,