{"id":18337768,"url":"https://github.com/pin3dev/42_pushswap","last_synced_at":"2025-10-17T03:05:36.893Z","repository":{"id":167054937,"uuid":"636187623","full_name":"pin3dev/42_PushSwap","owner":"pin3dev","description":"Algorithm challenge focused on sorting a stack of integers with the minimum number of operations. Implemented in C with a limited set of operations, ideal for understanding algorithm optimization.","archived":false,"fork":false,"pushed_at":"2025-01-24T21:31:25.000Z","size":7584,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-09T20:18:37.351Z","etag":null,"topics":["42cursus","42porto","42pushswap","42school","algorithm","c","sorting","sorting-algorithm","sorting-algorithms","tutorial","tutorial-sourcecode"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pin3dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2023-05-04T09:54:48.000Z","updated_at":"2025-01-24T21:31:29.000Z","dependencies_parsed_at":"2024-03-26T12:43:04.464Z","dependency_job_id":"36a6fe47-0c08-419e-8718-6d71c2da051f","html_url":"https://github.com/pin3dev/42_PushSwap","commit_stats":null,"previous_names":["pin3dev/push_swap","pin3dev/42_push_swap","pin3dev/42_pushswap"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pin3dev/42_PushSwap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pin3dev%2F42_PushSwap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pin3dev%2F42_PushSwap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pin3dev%2F42_PushSwap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pin3dev%2F42_PushSwap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pin3dev","download_url":"https://codeload.github.com/pin3dev/42_PushSwap/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pin3dev%2F42_PushSwap/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279275255,"owners_count":26138567,"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","status":"online","status_checked_at":"2025-10-17T02:00:07.504Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["42cursus","42porto","42pushswap","42school","algorithm","c","sorting","sorting-algorithm","sorting-algorithms","tutorial","tutorial-sourcecode"],"created_at":"2024-11-05T20:12:13.482Z","updated_at":"2025-10-17T03:05:36.873Z","avatar_url":"https://github.com/pin3dev.png","language":"C","readme":"\u003ch1 align=\"center\"\u003ePushSwap\u003c/h1\u003e\n\u003cp align=\"center\"\u003e \n  \u003cimg src=\"https://img.shields.io/badge/grade-100%2F100-green?style=for-the-badge\u0026logo=42\u0026labelColor=gray\"/\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e \n  \u003ca href=\"https://github.com/pin3dev/42_Cursus/tree/main/library/#02-Push_Swap\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Sorting_Algorithms-blue?style=for-the-badge\"/\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Data_structures-blue?style=for-the-badge\"/\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Stacks-blue?style=for-the-badge\"/\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Optimization-blue?style=for-the-badge\"/\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/pin3dev/42_Cursus/blob/a708c0de6d3fdc729bb720318b5d35bdaa9551c0/assets/PushSwap/Rdm/pushswap_vs.gif\" width=\"600\" height=\"375\" /\u003e\n\u003c/p\u003e\n\n\u003ch3\u003e\n  \u003cp align=\"center\"\u003e \n    \u003ca href=\"#introduction\"\u003eIntroduction\u003c/a\u003e • \n    \u003ca href=\"#structure\"\u003eStructure\u003c/a\u003e • \n    \u003ca href=\"#docs\"\u003eDocs\u003c/a\u003e • \n    \u003ca href=\"#cloning\"\u003eCloning\u003c/a\u003e • \n    \u003ca href=\"#usage\"\u003eUsage\u003c/a\u003e • \n    \u003ca href=\"#norms\"\u003eNorms\u003c/a\u003e • \n    \u003ca href=\"#theoretical\"\u003eTheoretical\u003c/a\u003e •   \n    \u003ca href=\"#tutorial\"\u003eTutorial\u003c/a\u003e • \n    \u003ca href=\"#contributors\"\u003eContributors\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/h3\u003e\n\n## 🗣️ Introduction \u003ca id=\"introduction\"\u003e\u003c/a\u003e\n\nThe **Push Swap** project is an algorithm challenge aimed at sorting a stack of integers in the least number of moves, using a constrained set of operations. This project serves as a way to deepen understanding of sorting algorithms and optimize problem-solving techniques.\n\nThis repository is dedicated to the implementation of an efficient solution to sort the stack using the minimum number of operations. The project does not include a checker, so the validation must be done with external tools or the checker provided by 42.\n\n## 🧬 Project Structure \u003ca id=\"structure\"\u003e\u003c/a\u003e\n\nThe **Push Swap** project is organized into different components based on the operations allowed to manipulate two stacks (A and B). The mandatory part includes creating algorithms to sort small to large sequences using the following operations:\n\n- **`sa`**, **`sb`**, **`ss`**: Swap operations on stack A, stack B, or both.\n- **`pa`**, **`pb`**: Push operations to move the top element from one stack to another.\n- **`ra`**, **`rb`**, **`rr`**: Rotate operations to move the top element to the bottom.\n- **`rra`**, **`rrb`**, **`rrr`**: Reverse rotate operations to move the bottom element to the top.\n\nThe project is focused on optimization and efficiency, aiming to minimize the number of moves for different stack sizes.\n\n## 🗃️ Documentation \u003ca id=\"docs\"\u003e\u003c/a\u003e\n\nFor detailed documentation, including usage examples and function breakdowns, please visit the link below:  \n\n\u003cp align=\"center\"\u003e \n  \u003ca href=\"https://github.com/pin3dev/42_Push_Swap/wiki\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/PushSwap_Docs-lightgreen?style=for-the-badge\"/\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n## 🫥 Cloning the Repository \u003ca id=\"cloning\"\u003e\u003c/a\u003e\n\nTo clone this repository and compile the project, run the following commands:\n\n```bash\ngit clone https://github.com/pin3dev/42_Push_Swap.git\ncd 42_Push_Swap/pushswap\n```\nThis will download the project from GitHub into your local machine. Once inside the `42_Push_Swap` directory, you can compile the project using the provided Makefile.\n\n## 🕹️ Compilation and Usage \u003ca id=\"usage\"\u003e\u003c/a\u003e\n\n### Makefile\n\nA `Makefile` is provided to simplify the compilation process. The Makefile includes the following rules:\n\n- `all`: Compiles the project.\n- `clean`: Removes object files.\n- `fclean`: Removes object files and the executable.\n- `re`: Recompiles the entire project from scratch.\n\nTo compile the project, simply run:\n```bash\nmake\n```\nThis will generate the `push_swap` executable, which can be used to sort a list of integers.\n\n### Basic Usage\n\nTo run the **Push Swap** algorithm on a list of integers:\n\n1. Execute the program with a set of integers as arguments:\n    ```bash\n    ./push_swap 3 5 2 1 4\n    ```\n\n2. The program will output a sequence of operations needed to sort the integers:\n    ```bash\n    pb\n    pb\n    sa\n    pa\n    rra\n    pa\n    rra\n    rra\n    ```\n\nYou can also test the number of operations by piping the output to `wc -l`:\n```bash\n./push_swap 3 5 2 1 4 | wc -l\n```\n\n## ⚠️ Norms and Guidelines Disclaimer \u003ca id=\"norms\"\u003e\u003c/a\u003e\n\nThis project strictly follows the [**42 School Norm**](https://github.com/pin3dev/42_Cursus/blob/b9cd0fe844ddb441d0b3efb98abcee92aee49535/assets/General/norme.en.pdf) coding guidelines, which significantly influenced certain decisions in its implementation. These rules may sometimes lead to seemingly inefficient or unusual solutions, but they were necessary to meet the strict requirements of the school.  \n\n## 📖 Theoretical Background \u003ca id=\"theoretical\"\u003e\u003c/a\u003e\n\nAll the theoretical material used to develop this project is organized and can be accessed directly via the link below:  \n\n\u003cp align=\"center\"\u003e \n  \u003ca href=\"https://github.com/pin3dev/42_Cursus/tree/main/library/#02-Push_Swap\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/PushSwap_Library-gray?style=for-the-badge\"/\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n## 🔬 Tutorial \u003ca id=\"tutorial\"\u003e\u003c/a\u003e\n\nA step-by-step tutorial is available and can be followed to complete the project. It is linked in the button below.   \n\n\u003cp align=\"center\"\u003e \n  \u003ca href=\"https://github.com/pin3dev/42_Cursus/tree/main/tutorial/PushSwap\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/PushSwap_Tutorial-lightgreen?style=for-the-badge\"/\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n## 👥 Contributors \u003ca id=\"contributors\"\u003e\u003c/a\u003e\n\n\u003ca href=\"https://github.com/pin3dev\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Ivany_Pinheiro-%40pin3dev-purple?style=for-the-badge\"/\u003e  \n\u003c/a\u003e  \n\u003cbr\u003e\n\u003ca href=\"https://github.com/clima-fr\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Clara_Franco-%40clima--fr-purple?style=for-the-badge\"/\u003e  \n\u003c/a\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpin3dev%2F42_pushswap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpin3dev%2F42_pushswap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpin3dev%2F42_pushswap/lists"}