I have strange behaviour in one of my functions.
Code of program is very huge and hardly readable. So i attaches part of functions.
If j
lower than 4, it returns not actual remainder, but difference between j and 4.
I tested and found, that 3 % 4 == 1
instead of 3.
while (j < 16)
{
if ((crd + (j % 4)) + d * (j / 4) > d * d && str2[j] == 1)
str[0] = 2;
if (((crd + (j % 4) + d * (j / 4)) / d) - i != (j / 4) && str2[j] == 1)
str[0] = 2;
if (str2[j] == 1)
str[(crd + (j % 4)) + d * (j / 4)] = str2[16];
if (str[(crd + (j % 4)) + d * (j / 4)] == 2 || str[0] == 2)
return (str);
j++;
}