From 603af77207d98b607de80bb734e4123bb9279786 Mon Sep 17 00:00:00 2001 From: Louie Shprung Date: Sat, 10 Dec 2022 16:59:04 -0800 Subject: Move include/ into src/ --- include/body.h | 19 ------------------- src/Makefile.am | 2 +- src/Makefile.in | 2 +- src/body.c | 2 +- src/draw.c | 2 +- src/include/body.h | 19 +++++++++++++++++++ 6 files changed, 23 insertions(+), 23 deletions(-) delete mode 100644 include/body.h create mode 100644 src/include/body.h diff --git a/include/body.h b/include/body.h deleted file mode 100644 index 29241bf..0000000 --- a/include/body.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef BODY_H -#define BODY_H - -typedef struct node NODE; - -typedef struct snake SNAKE; - -SNAKE *makeSnake(int startx, int starty, int len); -void deleteSnake(SNAKE *sp); - -void updateSnake(SNAKE *sp, int dir, int maxx, int maxy, bool *collision, int *fruit_loc, bool *fruit, int *score); -bool checkSnake(SNAKE *sp, int maxx, int maxy); - -int getSnakeTailx(SNAKE *sp); -int getSnakeTaily(SNAKE *sp); -int getSnakeHeadx(SNAKE *sp); -int getSnakeHeady(SNAKE *sp); - -#endif diff --git a/src/Makefile.am b/src/Makefile.am index 262aff6..ebbd287 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,3 +1,3 @@ bin_PROGRAMS = simple-snake -simple_snake_SOURCES = body.c draw.c body.h +simple_snake_SOURCES = body.c draw.c simple_snake_LDADD = -lncurses -lm diff --git a/src/Makefile.in b/src/Makefile.in index a2b78fd..a5ae1f3 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -246,7 +246,7 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -simple_snake_SOURCES = body.c draw.c body.h +simple_snake_SOURCES = body.c draw.c simple_snake_LDADD = -lncurses -lm all: all-am diff --git a/src/body.c b/src/body.c index bfee083..ad06411 100644 --- a/src/body.c +++ b/src/body.c @@ -2,7 +2,7 @@ #include #include -#include "../include/body.h" +#include "include/body.h" typedef struct node{ int x; diff --git a/src/draw.c b/src/draw.c index 4926f04..55f9013 100644 --- a/src/draw.c +++ b/src/draw.c @@ -10,7 +10,7 @@ #include #include -#include "../include/body.h" +#include "include/body.h" #define START_SIZE 4 //TODO consider having speed be affected by window size diff --git a/src/include/body.h b/src/include/body.h new file mode 100644 index 0000000..29241bf --- /dev/null +++ b/src/include/body.h @@ -0,0 +1,19 @@ +#ifndef BODY_H +#define BODY_H + +typedef struct node NODE; + +typedef struct snake SNAKE; + +SNAKE *makeSnake(int startx, int starty, int len); +void deleteSnake(SNAKE *sp); + +void updateSnake(SNAKE *sp, int dir, int maxx, int maxy, bool *collision, int *fruit_loc, bool *fruit, int *score); +bool checkSnake(SNAKE *sp, int maxx, int maxy); + +int getSnakeTailx(SNAKE *sp); +int getSnakeTaily(SNAKE *sp); +int getSnakeHeadx(SNAKE *sp); +int getSnakeHeady(SNAKE *sp); + +#endif -- cgit