Random word from file #5

This commit is contained in:
2017-05-02 18:22:29 +02:00
parent 83ffee4315
commit 37b129b811
5 changed files with 141 additions and 9 deletions

View File

@@ -1,5 +1,6 @@
/* Defined macros */
#define DEFAULTTRIES 9
#define MAXWORDLENGTH 100
/* Data structures */
typedef struct {
@@ -10,9 +11,9 @@ typedef struct {
int maxx;
int centery;
int centerx;
char guessWord[100];
char guessWord[MAXWORDLENGTH];
int wordLength;
char currentWord[100];
char currentWord[MAXWORDLENGTH];
char wrongCharacters[DEFAULTTRIES];
} game_state;
@@ -38,3 +39,4 @@ void showStartScreen(game_state *gs);
void startGame(game_state *gs);
void showHelp(game_state *gs);
int centerDiff(int coordinate, char *str);
void readRandomLine(char *file, char *result);