Previous version was validating sets with repeat colors.
The error appeared to be an incomplete check through the array;
when num_tiles was 3, it was checking index 0 and 1. Thus, if
index 0 and 2 had the same color, it wasn't being caught.
New version now steps through entire array.
printf("fail set - invalid num tiles; ");
return 0;
}
- for (i = 0; i < tile_group->num_tiles - 1; ++i)
+ for (i = 0; i <= tile_group->num_tiles - 1; ++i)
{
if (tile_group->tiles[i].number != tile_group->tiles[i + 1].number &&
i+1 != tile_group->num_tiles)