diff options
| author | Dominik Kaiser | 2024-04-13 15:09:19 +0200 |
|---|---|---|
| committer | Dominik Kaiser | 2024-04-13 15:09:19 +0200 |
| commit | 9585e1d336c6a1581b335798762172314de1fefb (patch) | |
| tree | d38b35b0f14c62249db79c95c6726d69c569e426 | |
| parent | e8e671060271e9471b37aedb712d30855ff9df8c (diff) | |
| download | push_swap-9585e1d336c6a1581b335798762172314de1fefb.tar.gz push_swap-9585e1d336c6a1581b335798762172314de1fefb.zip | |
Add sorting function (without any sorting yet)
| -rw-r--r-- | main.c | 7 | ||||
| -rw-r--r-- | push_swap.h | 4 | ||||
| -rw-r--r-- | sorting.c | 18 |
3 files changed, 25 insertions, 4 deletions
@@ -6,12 +6,10 @@ /* By: dkaiser <dkaiser@student.42heilbronn.de +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/04/12 17:03:30 by dkaiser #+# #+# */ -/* Updated: 2024/04/13 14:56:18 by dkaiser ### ########.fr */ +/* Updated: 2024/04/13 15:04:10 by dkaiser ### ########.fr */ /* */ /* ************************************************************************** */ -#include "libft/ft_printf.h" -#include "libft/libft.h" #include "push_swap.h" static void print_content(void *content) @@ -34,6 +32,9 @@ int main(int argc, char *argv[]) stack_b = NULL; pscmds = NULL; + stack_sort(&stack_a, &stack_b, &pscmds); + + // TODO: Optimize commands ft_printf("A:"); ft_lstiter(stack_a, print_content); diff --git a/push_swap.h b/push_swap.h index 8cfc473..b555a15 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 14:46:45 by dkaiser ### ########.fr */ +/* Updated: 2024/04/13 15:07:49 by dkaiser ### ########.fr */ /* */ /* ************************************************************************** */ @@ -41,4 +41,6 @@ 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_sort(t_list **stack_a, t_list **stack_b, t_list **cmds); + #endif // PUSH_SWAP_H diff --git a/sorting.c b/sorting.c new file mode 100644 index 0000000..3624ae5 --- /dev/null +++ b/sorting.c @@ -0,0 +1,18 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* sorting.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: dkaiser <dkaiser@student.42heilbronn.de +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2024/04/13 15:04:19 by dkaiser #+# #+# */ +/* Updated: 2024/04/13 15:06:33 by dkaiser ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "push_swap.h" + +void stack_sort(t_list **stack_a, t_list **stack_b, t_list **cmds) +{ + +} |
