-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrev_rotate.c
More file actions
32 lines (29 loc) · 1.15 KB
/
rev_rotate.c
File metadata and controls
32 lines (29 loc) · 1.15 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
/* ************************************************************************** */
/* */
/* :::::::: */
/* rev_rotate.c :+: :+: */
/* +:+ */
/* By: lorenasmienk <lorenasmienk@student.coda +#+ */
/* +#+ */
/* Created: 2019/12/26 12:37:16 by lorenasmien #+# #+# */
/* Updated: 2019/12/27 14:43:10 by lsmienk ######## odam.nl */
/* */
/* ************************************************************************** */
#include "push_swap.h"
void rev_rotate(t_stack *ar, char x)
{
int temp;
int i;
temp = ar->stack[0];
i = 0;
while (i < (ar->len - 1))
{
ar->stack[i] = ar->stack[i + 1];
i++;
}
ar->stack[i] = temp;
if (x == 'a')
ft_printf("rra\n");
if (x == 'b')
ft_printf("rrb\n");
}