push_swap/inc/push_swap.h
2024-11-19 16:16:34 +01:00

66 lines
2.1 KiB
C

/* ************************************************************************** */
/* */
/* ::: o_ :::::: ::: */
/* push_swap.h :+: / :+::+: :+: */
/* +:+ > +:++:+ +:+ */
/* By: whaffman <whaffman@student.codam.nl> +#+ +:+ +#++#++:++#++ */
/* +#+ +#+#+ +#++#+ +#+ \o/ */
/* Created: 2024/11/04 13:58:35 by whaffman #+#+# #+#+# #+# #+# | */
/* Updated: 2024/11/10 16:24:06 by whaffman ### ### ### ### / \ */
/* */
/* ************************************************************************** */
#ifndef PUSH_SWAP_H
# define PUSH_SWAP_H
# include "libft.h"
typedef struct s_state
{
t_list *a;
t_list *b;
} t_state;
t_list *ft_lstat(t_list *list, int n);
int ft_abs(int a);
int ft_max(int a, int b);
int stack_min(t_list *lst);
void print_stack(const char *name, t_list *stack);
void print_state(t_state *state);
void sortmore(t_state *state);
int sort3(t_state *state);
int count_gt(int n, t_list *stack);
int index_of(int number, t_list *stack);
int new_element(t_list **stack, const char *str);
int put_at_index_asc(int number, t_list *stack);
void push_all_but_3_b(t_state *state);
void push(t_list **stack_1, t_list **stack_2);
int shortest_rotate(int index, int size);
void common_rotations(int *shortest_a, int *shortest_b, t_state *state);
void rotate_b(int n, t_state *state);
void rotate_a(int n, t_state *state);
void rotate_a_to(int index, t_state *state);
int rotate_a_to_top(t_state *state);
void rotate(t_list **stack);
void reverse_rotate(t_list **stack);
void swap(t_list **stack);
void pa(t_state *state);
void pb(t_state *state);
void sa(t_state *state);
void sb(t_state *state);
void ss(t_state *state);
void ra(t_state *state);
void rb(t_state *state);
void rr(t_state *state);
void rra(t_state *state);
void rrb(t_state *state);
void rrr(t_state *state);
#endif