Initial commit; basic functionality
This commit is contained in:
33
hangman.h
Normal file
33
hangman.h
Normal file
@@ -0,0 +1,33 @@
|
||||
/* Defined macros */
|
||||
#define DEFAULTTRIES 9
|
||||
|
||||
/* Data structures */
|
||||
typedef struct {
|
||||
int moves;
|
||||
int allowedMoves;
|
||||
int maxy;
|
||||
int maxx;
|
||||
int centery;
|
||||
int centerx;
|
||||
char guessWord[100];
|
||||
int wordLength;
|
||||
char currentWord[100];
|
||||
char wrongCharacters[DEFAULTTRIES];
|
||||
} game_state;
|
||||
|
||||
typedef struct word {
|
||||
char character;
|
||||
struct word *next;
|
||||
} word;
|
||||
|
||||
|
||||
/* Function prototypes */
|
||||
void quitProgram(void);
|
||||
void updateScreen(game_state *gs);
|
||||
void initCoordinates(game_state *gs);
|
||||
void initGuessWord(game_state *gs);
|
||||
void drawGuessWord(game_state *gs);
|
||||
int playerInput(game_state *gs);
|
||||
int fillCurrentWord(game_state *gs, char validchar);
|
||||
int stackWrongCharacter(game_state *gs, char wrongchar);
|
||||
int checkWin(game_state *gs);
|
Reference in New Issue
Block a user