GithubHelp home page GithubHelp logo

kuninoto / 42_push_swap Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 1.65 MB

A program that sorts a stack of integers in the least steps possible, based on a limited set of instructions

Makefile 3.73% C 96.27%
42 42born2code 42cursus 42projects 42school 42-school 42porto 42portugal 42pushswap ecole42 push-swap push-swap42

42_push_swap's Introduction

push_swap (42Porto - 42Cursus) C Logo 

Grade: 90/100

Overview:

Push_swap is a program that sorts a stack of integers with the minimum instructions possible and an auxiliary stack. Instructions are defined within the subject of the project; They're the only way allowed to manipulate the data in the stacks.

checker is a utility program that, taking the same arguments as push_swap and its outputted instructions, checks if the stack ends up sorted, thus verifying if push_swap is correctly sorting the stack

Screenshot:

Installing and running the project:

1- Clone this repository

git clone https://github.com/Kuninoto/42_push_swap

2- Navigate to lvl_2_push_swap and run make

cd 42_push_swap/lvl_2_push_swap && make

3- make clean so that you don't keep those object files that you won't need anymore

make clean

4- Run push_swap with a list of integers of your choice!

./push_swap <nbr> <nbr> <nbr> <nbr> ...

Subject (v6): push_swap en_subject

Note:

Although I was only able to do an algorithm that gives 90/100 in this project (i.e the bonus part cannot be accessed on the evaluation) I've still made the bonus part because I found it interesting and quite easy. I left it on bonus folder for the record.

Makefile Available Targets:

make or make all - Makes push_swap
make clean - Deletes all the resulting object files
make fclean - Deletes push_swap and checker
make re - fclean + all
make bonus - Makes checker

Useful links:

Disclaimer

At 42School, almost every project must be written in accordance to the Norm, the schools' coding standard. As a result, the implementation of certain parts may appear strange and for sure had room for improvement.


Made by Nuno Carvalho (Kuninoto) | [email protected]

42_push_swap's People

Contributors

kuninoto avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.