{EPITECH} The goal of this project is to make a program to sort a number list, by using the fewest possible operations.
You can use two list for this project, l_a
and l_b
.
The operations that you can use are following :
sa
: swap the first two elements ofl_a
(nothing will happen if there aren’t enough elements).sb
: swap the first two elements ofl_b
(nothing will happen if there aren’t enough elements).sc
:sa
andsb
at the same time.pa
: take the first element froml_b
and move it to the first position ofl_a
(nothing will happen ifl_b
is empty).pb
: take the first element froml_a
and move it to the first position ofl_b
(nothing will happen ifl_a
is empty).ra
: rotatel_a
toward the beginning, the first element will become the last.rb
: rotatel_b
toward the beginning, the first element will become the last.rr
:ra
andrb
at the same time.rra
: rotatel_a
toward the end, the last element will become the first.rrb
: rotatel_b
toward the end, the last element will become the first.rrr
:rra
andrrb
at the same time.
Compilation
$> Make
Execution
$> ./pushswap 2 15 3 7 35 19 .....