I all ready used it!!
May 20, 2014 at 3:48am UTC
Im in the final touch up.
I cannot do the letter_used, says. U all ready used this letter!!
urghhh...i know its prob basic..but im going crazy w over 300 lines
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
void guess_letter (char word_player[], int word_size, char underscore[],char letter_used[], int guessed)
{
const int SIZE2 = 10;
char guess[SIZE2];
char LetterEntered,valid;
int x;
do {
printf("Enter a guess letter: " );
fgets(guess, word_size, stdin);
LetterEntered = guess[0];
LetterEntered = tolower(LetterEntered);
//printf("got letter %c\n",LetterEntered);
if (LetterEntered >= 'a' && LetterEntered <= 'z' )
{
valid = 'y' ;
for (x=0; x < word_size; x++)
{
if (word_player[x] == LetterEntered)
underscore[x] = LetterEntered;
}
printf("Now the word is %s\n" ,underscore);
for (x=0; x < word_size; x++)
{
if (word_player[x] != LetterEntered)
letter_used[guessed] = LetterEntered;
}
printf("Letters used %s\n" ,letter_used);
}
else
printf("Enter a char.\n" );
}while (valid != 'y' );
return ;
}
May 20, 2014 at 4:20am UTC
anyone pls..help!!
May 20, 2014 at 4:50am UTC
Could you please restate your problem as a clear question?
What are you trying to do, and what exactly is not working?
May 20, 2014 at 5:10am UTC
If the user all ready used the letter.
it should print a warning msg!!
thanks for looking
May 20, 2014 at 5:14am UTC
line 30
May 20, 2014 at 5:26am UTC
ive been doing the assigmnent for 50hrs +, its over 300 lines,
if was a real job I was fired lol
but I only been doing for 3 months
May 20, 2014 at 7:23am UTC
here its almost right!! OMG
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
void guess_letter (char word_player[], int word_size, char underscore[],char letter_used[], int guessed)
{
const int SIZE2 = 10;
char guess[SIZE2];
char used[SIZE2] = {'\0' };
char LetterEntered,valid;
int x;
do {
printf("Enter a guess letter: " );
fgets(guess, word_size, stdin);
LetterEntered = guess[0];
LetterEntered = tolower(LetterEntered);
//printf("got letter %c\n",LetterEntered);
if (LetterEntered >= 'a' && LetterEntered <= 'z' )
{
valid = 'y' ;
for (x=0; x < word_size; x++)
{
if (letter_used[x] == LetterEntered)
letter_used[guessed] = LetterEntered;
}
printf("you all ready used %c\n" ,LetterEntered);
for (x=0; x < word_size; x++)
{
if (word_player[x] == LetterEntered)
underscore[x] = LetterEntered;
}
printf("Now the word is %s\n" ,underscore);
for (x=0; x < word_size; x++)
{
if (word_player[x] != LetterEntered)
letter_used[guessed] = LetterEntered;
used[guessed] = LetterEntered;
}
printf("Letters used %s\n" ,letter_used);
}
else
printf("Enter a char.\n" );
}while (valid != 'y' );
return ;
}
Topic archived. No new replies allowed.