Your colorstr
is a noop. Also, for a proper working function you should adjust parameters and return type. Try:
char* colorstr(char piece)
{
return piece == '0' ? "000" : (isupper(piece) ? "Wht" : "Blk");
}
When you call it:
for (i=0; i<8; i++)
{
piece = board[(unsigned char)x/5][i];
clrptr = colorstr(piece); /* clrptr is returned
(was a local declaration before) */
printf("| %s |", clrptr);
}
printf("\n");