Nice job for a week-end =)
finished checker programm tested actions functions all normed and sexy ;)
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
/* By: tmaze <tmaze@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2019/02/21 16:07:55 by tmaze #+# #+# */
|
||||
/* Updated: 2019/02/24 13:56:33 by tmaze ### ########.fr */
|
||||
/* Updated: 2019/03/02 16:32:04 by tmaze ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -16,26 +16,27 @@ void ps_rot(t_psdata *data, char c)
|
||||
{
|
||||
t_stack *s;
|
||||
t_stack *tmp;
|
||||
t_stack *ind;
|
||||
size_t size;
|
||||
size_t *size;
|
||||
|
||||
if (c == 'a')
|
||||
s = data->a;
|
||||
if (c == 'a')
|
||||
size = data->size_a;
|
||||
size = &(data->size_a);
|
||||
else if (c == 'b')
|
||||
s = data->b;
|
||||
if (c == 'b')
|
||||
size = data->size_b;
|
||||
if (s != NULL && size > 2)
|
||||
size = &(data->size_b);
|
||||
if (s != NULL && *size > 2)
|
||||
{
|
||||
s = s->next;
|
||||
tmp = ps_stkpop(data, c);
|
||||
ind = s;
|
||||
while (ind->next != NULL)
|
||||
ind = ind->next;
|
||||
ind->next = tmp;
|
||||
tmp->next = NULL;
|
||||
while (s->next != NULL)
|
||||
s = s->next;
|
||||
s->next = tmp;
|
||||
(*size)++;
|
||||
}
|
||||
else if (s != NULL && size == 2)
|
||||
else if (s != NULL && *size == 2)
|
||||
ps_swap(data, c);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user