Skip to content
This repository has been archived by the owner on Jul 9, 2020. It is now read-only.

TBouder/push_swap

Repository files navigation

push_swap

PDF

###Gameplay

The project goal is to order a stack (A), using another stack (B) and only 11 possible moves. At the beginning B is empty and their is various unique integers in A.
The stack has to be ordered decreasingly (left to right || bottom to top)
sa : swap the top two elements on stack A
sb : swap the top two elements on stack B
ss : sa and sb at the same time
pb : take the top element of A and move it to the top of B
pa : take the top element of B and move it to the top of A
rra : move all the elements on A to the top, moving the top element to the bottom
rrb : move all the elements on B to the top, moving the top element to the bottom
rrr : rra and rrb at the same time
ra : move all the elements on A to the bottom, moving the bottom element to the top
rb : move all the elements on B to the bottom, moving the bottom element to the top
rr : ra and rb at the same time

###Bonus :

  • -v for verbose mode
  • -c for color mode
  • -o to display the number of operation at the end
  • -i to display some informations (Starting and ending stack)
  • -a for all previous flags
  • -s to display nothing
  • Possibility to use -vcio instead of -v -c -i -o
  • Custom messages for exit (Success, error, already ordered, only one number)
  • Usage message

###Requirements :

###Installation :

  1. git clone https://bitbucket.org/Tbouder/push_swap && cd push_swap
  2. git clone https://bitbucket.org/Tbouder/ft_printf && cd ft_printf
  3. git clone https://bitbucket.org/Tbouder/libft
  4. cd ..
  5. make
  6. ./push_swap [-vcoia] [n1 n2 ...]

About

Coucou, tu veux voir ma pile ?

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published