diff options
| author | Dominik Kaiser | 2024-04-13 14:39:57 +0200 |
|---|---|---|
| committer | Dominik Kaiser | 2024-04-13 14:39:57 +0200 |
| commit | 33cbe45795557da6a1cb8921c03bc5213e15b005 (patch) | |
| tree | 8bd4a39297278d5f26254efc9444bc4e5e4ad25b /stack_utils.c | |
| parent | 925c50a9b094f6d244b621c8750d5ecf0caa38a1 (diff) | |
| download | push_swap-33cbe45795557da6a1cb8921c03bc5213e15b005.tar.gz push_swap-33cbe45795557da6a1cb8921c03bc5213e15b005.zip | |
Finish command handling and add command printing
Diffstat (limited to 'stack_utils.c')
| -rw-r--r-- | stack_utils.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/stack_utils.c b/stack_utils.c index 7a22b47..ad14504 100644 --- a/stack_utils.c +++ b/stack_utils.c @@ -6,11 +6,10 @@ /* By: dkaiser <dkaiser@student.42heilbronn.de +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/04/12 20:31:30 by dkaiser #+# #+# */ -/* Updated: 2024/04/12 20:50:17 by dkaiser ### ########.fr */ +/* Updated: 2024/04/13 14:33:35 by dkaiser ### ########.fr */ /* */ /* ************************************************************************** */ -#include "libft/libft.h" #include "push_swap.h" void stack_swap(t_list **stack) @@ -44,11 +43,11 @@ void stack_rotate(t_list **stack) void stack_rrotate(t_list **stack) { - t_list *first_elem; + t_list *first_elem; - first_elem = *stack; - while((*stack)->next->next) - *stack = (*stack)->next; - (*stack)->next->next = first_elem; - (*stack)->next = NULL; + first_elem = *stack; + while ((*stack)->next->next) + *stack = (*stack)->next; + (*stack)->next->next = first_elem; + (*stack)->next = NULL; } |
