diff --git a/Makefile b/Makefile index f3ea16f..e2cd596 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,7 @@ OBJ_PATH = obj VPATH = src:src/util:src/moves:src/sort SOURCES = push_swap.c ft_lstat.c new_element.c push.c rotate.c reverse_rotate.c \ - swap.c sort3.c sort5.c stack_min.c stack_max.c + swap.c sort3.c sort5.c stack_min.c stack_max.c utils.c OBJECTS = $(addprefix $(OBJ_PATH)/, $(SOURCES:.c=.o)) diff --git a/inc/push_swap.h b/inc/push_swap.h index aeb7d56..e92de28 100644 --- a/inc/push_swap.h +++ b/inc/push_swap.h @@ -6,7 +6,7 @@ /* By: whaffman +#+ +:+ +#++#++:++#++ */ /* +#+ +#+#+ +#++#+ +#+ \o/ */ /* Created: 2024/11/04 13:58:35 by whaffman #+#+# #+#+# #+# #+# | */ -/* Updated: 2024/11/07 16:37:19 by whaffman ### ### ### ### / \ */ +/* Updated: 2024/11/10 16:24:06 by whaffman ### ### ### ### / \ */ /* */ /* ************************************************************************** */ @@ -21,7 +21,10 @@ typedef struct s_state t_list *b; } t_state; -int rotate_a_to_top(t_state *state); +int index_of(int number, t_list *stack); +int put_at_index(int number, t_list *stack); +int rotate_a_to_top(t_state *state); +int shortest_rotate(int index, int size); int new_element(t_list **stack, const char *str); t_list *ft_lstat(t_list *list, int n); void print_stack(const char *name, t_list *stack);