{"id":21722627,"url":"https://github.com/shexweeknd/42-cursus-push_swap","last_synced_at":"2025-03-20T22:14:27.704Z","repository":{"id":241251535,"uuid":"804162273","full_name":"shexweeknd/42-cursus-push_swap","owner":"shexweeknd","description":"This repository contains the implementation of the Push Swap project from 42 School.","archived":false,"fork":false,"pushed_at":"2024-09-30T05:48:06.000Z","size":374,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-25T19:07:45.823Z","etag":null,"topics":["42","42antananarivo","42born2code","42cursus","42projects","42school","c","hramaros","mechanical-turk","pushswap","pushswap-42","pushswap-tester","pushswap42"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shexweeknd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-22T04:31:19.000Z","updated_at":"2024-09-30T07:47:44.000Z","dependencies_parsed_at":"2024-06-13T14:23:03.759Z","dependency_job_id":"fe1778b3-c8f6-44bb-975b-5eba9a0a450c","html_url":"https://github.com/shexweeknd/42-cursus-push_swap","commit_stats":null,"previous_names":["shexweeknd/42-cursus-push_swap"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shexweeknd%2F42-cursus-push_swap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shexweeknd%2F42-cursus-push_swap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shexweeknd%2F42-cursus-push_swap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shexweeknd%2F42-cursus-push_swap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shexweeknd","download_url":"https://codeload.github.com/shexweeknd/42-cursus-push_swap/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244700594,"owners_count":20495574,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["42","42antananarivo","42born2code","42cursus","42projects","42school","c","hramaros","mechanical-turk","pushswap","pushswap-42","pushswap-tester","pushswap42"],"created_at":"2024-11-26T02:30:40.802Z","updated_at":"2025-03-20T22:14:27.685Z","avatar_url":"https://github.com/shexweeknd.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Push Swap\n\nThis repository contains the implementation of the **Push Swap** project from 42 School.\n\n## Description\n\nThe **Push Swap** project is a sorting algorithm implementation. It takes a stack of integers as input and sorts them using a limited set of operations. The goal is to sort the stack with the minimum number of operations.\n\n## Algorithm\n\n![algorithm](https://github.com/shexweeknd/blob/blob/main/42-cursus-push_swap/algo-overview.png)\n\nThe **Push Swap** can be solved from various algorithms to efficiently sort the stack.\n\nI saw a bit of them during the 42 Cursus:\n\n- Radix Sort\n- Mechanical Turk\n- Chunk Algorithm\n- ...\n  \nFor my part I decided to use `Mechanical Turk` combined with `Chunk Algorithm`.\n\n**Mechanical Turk**: for its mechanical simplicity, that completely suits to my brain.\n\n**Chunk Algorithm**: for its savings in terms of operations. It also makes some order in the stack while processing Turk.\n\nThe code minimizes the number of operations required by analyzing the stack and performing the most optimal moves.\n\n## Usage\n\nTo use the **Push Swap** program, follow these steps:\n\n- Clone this repository\n\n```sh\ngit clone https://github.com/shexweeknd/42-cursus-push_swap.git\n```\n\n- Compile the program using the provided Makefile.\n\n```sh\ncd 42-cursus-push_swap/ \u0026\u0026\\\n\nmake all bonus\n```\n\n**MANDATORY PART**:\n\n- Run the program with the input stack as an argument.\n\n```bash\n./push_swap \u003cstack\u003e\n```\n\n\u003e**example:**\n\n```bash\n./push_swap 28 0 42 73 1 6\n```\n\n**BONUS PART**: [ONLY IF MANDATORY PART IS PERFECT]\n\n- The binary `checker` is a tester for `push_swap`, here is how it works:\n\n```bash\n./push_swap \u003cstack\u003e | ./checker \u003cstack\u003e\n```\n\n\u003e**example:**\n\n```bash\n./push_swap 28 0 42 73 1 6 | ./checker 28 0 42 73 1 6\n```\n\nIf the test succeed then it will display `OK` else it will display `KO`.\n\nYou can also proceed as follow:\n\n```bash\n./checker 28 0 42 73 1 6\n```\n\nThen you give the operations in the prompt, then `Ctrl + D` to evaluate the sorting commands.\n\n![example-of-checker](https://github.com/shexweeknd/blob/blob/main/42-cursus-push_swap/bonus-example.png)\n\nIf the test succeed then it will display `OK` else it will display `KO`.\n\n## Resources\n\nTo get start with the mechanical Turk Algorithm, as well as the chunck algorithm follow those links:\n\n- \u003chttps://medium.com/@ayogun/push-swap-c1f5d2d41e97\u003e\n- \u003chttps://www.youtube.com/watch?v=50f7SgnWPCk\u0026pp=ygUaY2h1bmtzIGFsZ29yaXRobSBwdXNoX3N3YXA%3D\u003e\n- \u003chttps://www.youtube.com/watch?v=2aMrmWOgLvU\u003e\n- \u003chttps://vscza.itch.io/push-swap\u003e\n\n## Contributions\n\nContributions to this project are welcome. If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.\n\n## Project Goals\n\n- Learn complex and advanced sorting algorithms.\n- Improve C programming skills regarding shained list.\n\n## License\n\n![42-antananarivo-logo](https://github.com/shexweeknd/blob/blob/main/42-cursus-so_long/42-cursus-so_long-42-logo.png)\n\nThis project is from 42 School Common Core Cursurs. I do not own any of the concept mentionned above. Instead I own the provided code in the repository.\n\nLicensed under the [MIT License](https://github.com/shexweeknd/blob/blob/main/LICENSE).\n\n## Acknowledgments\n\n- 42 Network for providing the project.\n- Axian Group\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshexweeknd%2F42-cursus-push_swap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshexweeknd%2F42-cursus-push_swap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshexweeknd%2F42-cursus-push_swap/lists"}