This is a simple but efficient tester for the 42 push-swap project. It helped me get 4/5 on both 100 and 500 size stacks.
The project asks the student to write a program that can sort a given stack with the least number of actions possible.
- Simple ruby program to generate stacks
- Homemade checker program
- push-swap tester
- Clone the project:
In your terminal, preferably in the same directory as your project run:git clone [email protected]:jlsrvr/PUSH-SWAP-TESTER.git
- Move into the cloned directory:
cd PUSH-SWAP_TESTER
- Generate the configuration file:
./run_specs.sh
- Edit the generated <my_config.sh> by adding the path to your project
- Run the tester
./run_specs.sh
- Stacks that fail can either be found in the output or in the specified files.
- Basic tests for error cases.
- Behaviour for a sorted stack of size up to 100.
- Uses the given max number of actions to determine if algorithm is fast enough (see configuration file).
- For stacks of size 5, 100, and 500 performs an average on randomly generated stacks (see configuration file to change number of runs).
At the root of the tester run this command in your terminal:ruby srcs/stack_generator.rb
Follow the on screen prompts.
All feedback welcome! Don't hesitate to create an issue or contact me on slack at jrivoire.