From 9891f38ddcca971fa21ab61e7a70832c8c877b0a Mon Sep 17 00:00:00 2001 From: Michael Hunteman Date: Sat, 23 Sep 2023 12:53:46 -0500 Subject: Initial commit --- maze/point.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 maze/point.c (limited to 'maze/point.c') diff --git a/maze/point.c b/maze/point.c new file mode 100644 index 0000000..c83c80d --- /dev/null +++ b/maze/point.c @@ -0,0 +1,29 @@ +#include +#include +#include "data_structures.h" + +struct point *head; + +void +push(int x, int y, char c) +{ + struct point *tmp = malloc(sizeof(struct point)); + tmp->c = c; + tmp->x = x; + tmp->y = y; + tmp->next = head; + head = tmp; +} + +char +pop() +{ + if (head == NULL) { + return -1; + } + struct point *tmp = head; + char c = tmp->c; + head = head->next; + free(tmp); + return c; +} -- cgit v1.2.3