This is my solution for the push_swap project from 42 school. I follow an approach where I calculate a price for every number and then always move the cheapest element. Price means the amount of operations you have to do to sort the number correctly back into stack a.
- It is only the mandatory part with 100/100 points.
- I solve 500 numbers with < 5000 operations and 100 numbers with < 600 operations.
Inside of the makefile you have following command:
- The classics: all, clean, fclean and re.
- Test: Compiles everything and executes the program with the arguments set in ARG = .
- Debug: Compiles everything with the -g flag so you can use a debugger.