From 78971391ddd9460846aafae6abc9ff73f2d43ef9 Mon Sep 17 00:00:00 2001 From: Darius Drake Date: Fri, 8 Dec 2023 20:36:53 -0400 Subject: [PATCH] Updated: moved prototypes to header file --- serpent.c | 22 ---------------------- serpent.h | 23 +++++++++++++++++++++++ 2 files changed, 23 insertions(+), 22 deletions(-) diff --git a/serpent.c b/serpent.c index 26d0e0b..5d7c8ea 100644 --- a/serpent.c +++ b/serpent.c @@ -48,28 +48,6 @@ Snake *snake; Apple *apple; /* */ -/* Function prototypes */ -Snake *startSnake(); -Apple *startApple(); -void appendSnakeNode(Snake *new_snake); -void freeSnake(); -int snakeSize(); -void updateSnake(); -void updateApple(); -bool snakeCollision(int x, int y, bool excludeHead); -bool appleCollision(int x, int y); -void handleInput(int key); -void drawGame(); -int initializeGame(); -void gameLoop(); -void run(); -void mainMenu(WINDOW *menuScreen, int menuType); -void cleanup(); -void argControls(); -void argHelp(); -void argVersion(); -/* */ - int main (int argc, char **argv) { /* Command line parsing */ int option; diff --git a/serpent.h b/serpent.h index 4f7f447..059b030 100644 --- a/serpent.h +++ b/serpent.h @@ -1,5 +1,6 @@ #ifndef SERPENT_H #define SERPENT_H +#include /* Program information */ #define NAME "serpent" @@ -47,4 +48,26 @@ typedef struct Food { int pX, pY; /* represents the apple's position on the board */ } Apple; +/* Function prototypes */ +Snake *startSnake(); +Apple *startApple(); +void appendSnakeNode(Snake *new_snake); +void freeSnake(); +int snakeSize(); +void updateSnake(); +void updateApple(); +bool snakeCollision(int x, int y, bool excludeHead); +bool appleCollision(int x, int y); +void handleInput(int key); +void drawGame(); +int initializeGame(); +void gameLoop(); +void run(); +void mainMenu(WINDOW *menuScreen, int menuType); +void cleanup(); +void argControls(); +void argHelp(); +void argVersion(); +/* */ + #endif //SERPENT_H