Push_Swap focuses on the sorting of stacks in the least amount of moves.
Mandatory: 86/100
Bonus: 25/25
Peers: 111% (avg)
Total: 111/125
To get started, clone the Push_Swap repo and go into the folder:
git clone https://github.com/FWMoor/Push_Swap
cd Push_Swap/Push_Swap
make
./push_swap [numbers]
./checker [-cmosuv] [numbers]
-c
- Adds colour to the output/commands/numbers.
-m
- Shows total amount of moves made.
-o
- Shows last command done on stacks.
-s
- Slows down commands in visual mode to 0.5s.
-u
- Displays a usage page.
-v
- Enables visuls modes.
sa
- Swap the first 2 elements at the top of stack A.
sb
- Swap the first 2 elements at the top of stack B.
ss
- Does sa
and sb
at the same time.
pa
- Takes top element of stack B and puts it at the top of stack A.
pb
- Takes top element of stack A and puts it at the top of stack B.
ra
- Shift up all elements of stack A by 1.
rb
- Shift up all elements of stack B by 1.
rr
- Does ra
and rb
at the same time.
rra
- Shift down all elements of stack A by 1.
rrb
- Shift down all elements of stack B by 1.
rrr
- Does rra
and rrb
at the same time.
Use my code at your own risk!
I've listed a few names of people that have helped me with push_swap.
Be sure to check out their profiles when you have time.
Calvin - Most of my logic.
Verona - Memory management, moral support and advice.