Skip to content

jlsrvr/PUSH-SWAP-TESTER

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Push-swap tester

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.

Included

  • Simple ruby program to generate stacks
  • Homemade checker program
  • push-swap tester

Usage tester

  1. Clone the project:
    In your terminal, preferably in the same directory as your project run:
    git clone [email protected]:jlsrvr/PUSH-SWAP-TESTER.git
  2. Move into the cloned directory:
    cd PUSH-SWAP_TESTER
  3. Generate the configuration file:
    ./run_specs.sh
  4. Edit the generated <my_config.sh> by adding the path to your project
  5. Run the tester
    ./run_specs.sh
  6. Stacks that fail can either be found in the output or in the specified files.

Covered:

  • 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).

Usage stack generator

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published