Ok so I've done some tinkering and most of the issues lie in the draw function. Here's what i've done.. sorry if it offends your expert eyes haha
Code:
#include <stdio.h>#include <string.h>
int draw_guess(int length, char guess, char word[]) //the function draws the unguessed letters (dashes) and updates it when guessed correctly
{
//Draws the dashes
int i, startup;
char display[7];
if(startup != 1)
startup = 0;
//Updates the dashes with the properly guessed letters
if((startup = 1))//only goes after the initial dashes are printed
{
for(i=0; i<length; i++)
{
if(word[i] == guess)
{
display[i] = guess;
printf("%s", display[i]);
}
else return 1; //if an incorrect letter is guessed, the function returns 1
}
else//this is just to print the initial dashes
{
for(i=0; i<length; i=i+)
{
display[i] = 'i';
printf("%s", display[i]);
}
}
startup = 1;
}
Since each possibility needs a return value, but I only care about when it is false, would just assigning a different return value change what the "correct guess" part of the assignment displays?
My compiler is giving some warnings that I dont quite understand either..
A syntax error in line 30 before the ) token
both printf("%s blah blah) parts come up saying argument is not a pointer
line 37 type defaults to "int" in declaration of startup