Skip to content

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

Notifications You must be signed in to change notification settings

Kuninoto/42_push_swap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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) | nnuno-ca@student.42porto.com

About

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

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages