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 51
|
void get_word_player2 (char word_player[], int size,char underscore[], int word_size)
{
//char underscore looks like: char underscore[SIZE] = {'_','_','_','_','_','_'}; in main
int turns=10;
int i,x, valid;
char guess;
char used_letters[10] = {'\0'}; //why cant u put turns into []
welcome_screen2();
for (i=0; i < word_size; i++)
{
printf("\"%s\"", underscore);
}
for (x=0; x < turns; x++)
{
for (i=0; i < word_size; i++)
{
guess_word (word_player, size); //if this happens needs to get ou the loop
get_input (guess, valid);
if(guess != word_player[i])
{
printf("The letter \"%c\" is NOT the word\n", guess);
used_letters[i] = guess;
printf("These are the letters you have used: ");
for (i=0; i < word_size; i++)
{
printf("\"%s\"", used_letters);
}
}
else
printf("The letter \"%c\" is IN the word\n", guess);
underscore[i] = guess;
for (i=0; i < word_size; i++)
{
printf("\"%s\"", underscore);
}
if(turns == 1)
printf("last chance.\n");
}
}
return;
}
|