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) void pb(t_state *state)
{ {
push(&(state->a), &(state->b)); push(&(state->a), &(state->b));
#ifndef SILENT
ft_printf("pb\n"); ft_printf("pb\n");
#endif
} }
void pa(t_state *state) void pa(t_state *state)
{ {
push(&(state->b), &(state->a)); push(&(state->b), &(state->a));
#ifndef SILENT
ft_printf("pa\n"); ft_printf("pa\n");
#endif
} }
void push(t_list **stack_1, t_list **stack_2) void push(t_list **stack_1, t_list **stack_2)

View File

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

View File

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

View File

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