i have problem that the the loop to check if a digit is correct but not at the right place.
then print.
void feedback( char random[4], char guess[5])
{
int i;
for(i=0; i<4; i++)
{
if(guess[i]==random[i])
{
printf("#");
}
}
if((guess[0]==random[1]||guess[0]==random[2]||guess[0]==random[3])&&guess[0]!=random[0])
{
printf("*");
}
if((guess[1]==random[0]||guess[1]==random[2]||guess[1]==random[3])&&guess[1]!=random[1])
{
printf("*");
}
if((guess[2]==random[0]||guess[2]==random[1]||guess[2]==random[3])&&guess[2]!=random[2])
{
printf("*");
}
if((guess[3]==random[0]||guess[3]==random[1]||guess[3]==random[2])&&guess[3]!=random[3])
{
printf("*");
}
printf("\n");
}
how to make sure the same digit is not used twice?