EPITECH project - Elementary Programming in C
Report Bug
·
Request Feature
If you are seeing this repository, please just star it! It will not take much time! :)
The program is made up of two lists of numbers named l_a and l_b. In the biginning, l_b will be empty and l_a will contain a certain amount of positive or negative numbers. The obective of the game is to sort l_a
saswap the first two elements of l_a (nothing will happen if there aren’t enough elements).sbswap the first two elements of l_b (nothing will happen if there aren’t enough elements).scsa and sb at the same time.patake the first element from l_b and move it to the first position on the l_a list (nothing will happen if l_b is empty).pbtake the first element from l_a and move it to the first position on the l_b list (nothing will happen if l_a is empty).rarotate l_a toward the beginning, the first element will become the last.rbrotate l_b toward the beginning, the first element will become the last.rrra and rb at the same time.rrarotate l_a toward the end, the last element will become the first.rrbrotate l_b toward the end, the last element will become the first.rrrrra and rrb at the same time.
- Makefile using gcc
- write
- malloc
- free
Test the program with your list of number as parameter
./push_swap 1 12 3 -4 [...]
