push swap, a 42 school project about ordination algorithm.
Tip
This project was done with in TDD mode -> Test Driven Development.
If you wanna try my tester, you should type:
cd _ci_tdd && make
- What's the difference between them?
- Which one is required for the
push_swap
project?
Let's suppose that you need to commute from your house to your work by car, but here is a traffic jam ahead, like Mr. Goofy from Disney: https://www.youtube.com/watch?v=_Tlk6e61E6w
You can drive like Mr. Goofy but at crazy mode accelerating a lot, changing lanes every second, hitting brakes... and eventually arriving at work.
But probably, you burned some really important resources from your car (gas, oil, brakes, engine), and from yourself (mental health, stress, anxiety, etc...)
However, you can also goes like the initial state from Mr. Goofy: a pleasant guy which could find another path or even just wait with pacience and love the innevitable truth: there will be a traffic jam ahead.
Without burning your brain, tires and fuel unnecessarily.
Push Swap is about a program that sort numbers from user's input, but also:
- has 2 stacks to store the given numbers;
- has 11 basic functions to move the numbers between stacks;
- calculates the cost of every number, with a given target
- search for the cheapest moviment
- do the moviments to sort the list Even with cost calculation, this program works only with efficiency mode (the goal, whatever it takes). The project's algorithm was created by Mia Combeau: https://github.com/mcombeau/push_swap
If you wanna try my Push_Swap, you should type:
make