summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--main.c3
-rw-r--r--optimization.c18
-rw-r--r--push_swap.h4
4 files changed, 24 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 5509c89..0199c15 100644
--- a/Makefile
+++ b/Makefile
@@ -5,7 +5,7 @@ LIBFT = libft
CC = cc
CFLAGS = -Wall -Wextra -Werror
-SRC_FILES = main.c input_handling.c stack_utils.c command_handling.c sorting.c
+SRC_FILES = main.c input_handling.c stack_utils.c command_handling.c sorting.c optimization.c
OBJ_FILES = $(SRC_FILES:%.c=%.o)
LIB_DIR = $(LIBFT)
diff --git a/main.c b/main.c
index 1476fb1..fbeee27 100644
--- a/main.c
+++ b/main.c
@@ -6,7 +6,7 @@
/* By: dkaiser <dkaiser@student.42heilbronn.de +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/04/12 17:03:30 by dkaiser #+# #+# */
-/* Updated: 2024/04/13 15:31:05 by dkaiser ### ########.fr */
+/* Updated: 2024/04/13 15:32:03 by dkaiser ### ########.fr */
/* */
/* ************************************************************************** */
@@ -31,6 +31,7 @@ int main(int argc, char *argv[])
}
stack_b = NULL;
pscmds = NULL;
+ stack_optimize(&stack_a);
stack_sort(&stack_a, &stack_b, &pscmds);
// TODO: Optimize commands
print_commands(pscmds);
diff --git a/optimization.c b/optimization.c
new file mode 100644
index 0000000..4348acf
--- /dev/null
+++ b/optimization.c
@@ -0,0 +1,18 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* optimization.c :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: dkaiser <dkaiser@student.42heilbronn.de +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2024/04/13 15:25:05 by dkaiser #+# #+# */
+/* Updated: 2024/04/13 15:29:58 by dkaiser ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+#include "push_swap.h"
+
+void stack_optimize(t_list **stack)
+{
+
+}
diff --git a/push_swap.h b/push_swap.h
index b555a15..978fb1d 100644
--- a/push_swap.h
+++ b/push_swap.h
@@ -6,7 +6,7 @@
/* By: dkaiser <dkaiser@student.42heilbronn.de +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/04/12 16:59:09 by dkaiser #+# #+# */
-/* Updated: 2024/04/13 15:07:49 by dkaiser ### ########.fr */
+/* Updated: 2024/04/13 15:27:07 by dkaiser ### ########.fr */
/* */
/* ************************************************************************** */
@@ -41,6 +41,8 @@ void run_command(t_list **stack_a, t_list **stack_b, t_list **cmds,
enum e_pscmd cmd);
void print_commands(t_list *cmds);
+void stack_optimize(t_list **stack);
+
void stack_sort(t_list **stack_a, t_list **stack_b, t_list **cmds);
#endif // PUSH_SWAP_H