-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathret_sorted_bstack.c
More file actions
33 lines (30 loc) · 1.14 KB
/
ret_sorted_bstack.c
File metadata and controls
33 lines (30 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/* ************************************************************************** */
/* */
/* :::::::: */
/* ret_sorted_bstack.c :+: :+: */
/* +:+ */
/* By: lsmienk <lsmienk@student.codam.nl> +#+ */
/* +#+ */
/* Created: 2020/01/02 16:21:15 by lsmienk #+# #+# */
/* Updated: 2020/01/02 16:57:05 by lsmienk ######## odam.nl */
/* */
/* ************************************************************************** */
#include "push_swap.h"
int ret_sorted_bstack(t_setting *set, int part)
{
int x;
x = part;
while (x > 1)
{
rotate(set->b, 'b');
x--;
}
while (x < part)
{
push(set->b, set->a, 'a');
rev_rotate(set->b, 'b');
x++;
}
push(set->b, set->a, 'a');
return (0);
}