I would do the check in stages. For the piecesOnGoal you only need the count, not the individual numbers. So start like this:
int piecesOnGoal = 0, piecesOnBase = 0;
for (int i = 0; i < 4; i++)
{
if (piecePositions[i] > 50)
piecesOnGoal++;
else if (piecePositions[i] < 4)
piecesOnBase++;
}
// If pieces on base and in goal don't add up to 4, return false.
// If pieces on base is 4, rturn true.
for (int i = 0; i < piecesOnGoal; i++)
{
// Check here that piecePositions contains an element 54 - i.
// if there is none, return false.
}
return true;
The good thing about pessimism is, that you are always either right or pleasently surprised.