This commit is contained in:
Willem Haffmans 2024-11-24 16:00:33 +00:00
parent ef03d90fec
commit d0f8e125c3
4 changed files with 22 additions and 0 deletions

View File

@ -16,13 +16,17 @@
void pb(t_state *state)
{
push(&(state->a), &(state->b));
#ifndef SILENT
ft_printf("pb\n");
#endif
}
void pa(t_state *state)
{
push(&(state->b), &(state->a));
#ifndef SILENT
ft_printf("pa\n");
#endif
}
void push(t_list **stack_1, t_list **stack_2)

View File

@ -16,20 +16,26 @@
void rra(t_state *state)
{
reverse_rotate(&(state->a));
#ifndef SILENT
ft_printf("rra\n");
#endif
}
void rrb(t_state *state)
{
reverse_rotate(&(state->b));
#ifndef SILENT
ft_printf("rrb\n");
#endif
}
void rrr(t_state *state)
{
reverse_rotate(&(state->a));
reverse_rotate(&(state->b));
#ifndef SILENT
ft_printf("rrr\n");
#endif
}
void reverse_rotate(t_list **stack)

View File

@ -16,20 +16,26 @@
void ra(t_state *state)
{
rotate(&(state->a));
#ifndef SILENT
ft_printf("ra\n");
#endif
}
void rb(t_state *state)
{
rotate(&(state->b));
#ifndef SILENT
ft_printf("rb\n");
#endif
}
void rr(t_state *state)
{
rotate(&(state->a));
rotate(&(state->b));
#ifndef SILENT
ft_printf("rr\n");
#endif
}
void rotate(t_list **stack)

View File

@ -16,20 +16,26 @@
void sa(t_state *state)
{
swap(&(state->a));
#ifndef SILENT
ft_printf("sa\n");
#endif
}
void sb(t_state *state)
{
swap(&(state->b));
#ifndef SILENT
ft_printf("sb\n");
#endif
}
void ss(t_state *state)
{
swap(&(state->a));
swap(&(state->b));
#ifndef SILENT
ft_printf("ss\n");
#endif
}
void swap(t_list **stack)