Mise a jour
This commit is contained in:
parent
719b712dae
commit
aa87242f7d
30
push_swap.c
30
push_swap.c
|
@ -6,7 +6,7 @@
|
|||
/* By: erey-bet <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2022/11/23 16:48:12 by erey-bet #+# #+# */
|
||||
/* Updated: 2022/11/23 17:25:59 by erey-bet ### ########.fr */
|
||||
/* Updated: 2022/11/27 23:10:27 by erey-bet ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -15,31 +15,53 @@
|
|||
|
||||
#include <stdio.h>
|
||||
|
||||
void push_swap(int *pa)
|
||||
void get_index(int *tab, int **index)
|
||||
{
|
||||
int i;
|
||||
int min;
|
||||
int new_index;
|
||||
|
||||
i = 0;
|
||||
min = tab[0];
|
||||
new_index = 0;
|
||||
while (i < argc)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void push_swap(int *tab, int argc)
|
||||
{
|
||||
int *index;
|
||||
|
||||
index = malloc(sizeof(int) * (argc + 1));
|
||||
get_index(tab, &index);
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int *tab;
|
||||
int i;
|
||||
int y;
|
||||
int test;
|
||||
|
||||
tab = malloc(sizeof(int) * argc);
|
||||
tab = malloc(sizeof(int) * (argc + 1));
|
||||
i = 0;
|
||||
y = 0;
|
||||
if (argc > 1)
|
||||
{
|
||||
while (++i < argc)
|
||||
{
|
||||
if(ft_atoi_check(argv[i]))
|
||||
*tab++ = ft_atoi(argv[i]);
|
||||
tab[y++] = ft_atoi(argv[i]);
|
||||
else
|
||||
{
|
||||
write(1, "Error\n", 6);
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
tab[y] = NULL;
|
||||
push_swap(tab, argc);
|
||||
}
|
||||
|
||||
return (0);
|
||||
|
|
Loading…
Reference in a new issue