push_swap/push_swap.h
Etienne Rey-bethbeder 61a3861d39 Projet Fini
2022-12-08 17:47:06 +01:00

47 lines
1.6 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* push_swap.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: erey-bet <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/11/23 16:51:31 by erey-bet #+# #+# */
/* Updated: 2022/12/08 11:23:13 by erey-bet ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef PUSH_SWAP_H
# define PUSH_SWAP_H
# include <unistd.h>
# include <stdlib.h>
# include "libft/libft.h"
typedef struct s_stack
{
long *list;
int len;
} t_stack;
// Push Swap
void post_push_swap(t_stack sa, t_stack sb, int x, int sa_len);
void pre_push_swap(long *tab, int len);
void push_swap_5(long *tab, int len);
void push_swap_3(long *tab, int len);
// Operations
void swap(t_stack *s, char *message);
void push(t_stack *s_push, t_stack *s_receive, char *message);
void rotate(t_stack *s, char *message);
// Tools
int get_min(long *tab, int len);
long *get_index(long *tab, int len);
int max_len_binary(t_stack s);
int check_sa(t_stack s);
// Parsing
int parsing(int argc, char *argv[], long *tab);
#endif