{"id":20350468,"url":"https://github.com/ekkoz897/42cursus_push_swap","last_synced_at":"2025-09-23T12:32:28.804Z","repository":{"id":117623279,"uuid":"592759541","full_name":"Ekkoz897/42cursus_Push_swap","owner":"Ekkoz897","description":"This project aims to sort data on a stack, with a limited set of instructions, using the lowest possible number of actions. ","archived":false,"fork":false,"pushed_at":"2024-03-21T18:08:46.000Z","size":330,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-14T22:34:57.524Z","etag":null,"topics":["42born2code","42cursus","42school","algorithms","c","push-swap","sorting-algorithms","stacks"],"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/Ekkoz897.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":"2023-01-24T13:29:32.000Z","updated_at":"2024-03-21T18:03:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"e4a1aba7-1301-46c1-8299-a996239e7881","html_url":"https://github.com/Ekkoz897/42cursus_Push_swap","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ekkoz897%2F42cursus_Push_swap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ekkoz897%2F42cursus_Push_swap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ekkoz897%2F42cursus_Push_swap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ekkoz897%2F42cursus_Push_swap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ekkoz897","download_url":"https://codeload.github.com/Ekkoz897/42cursus_Push_swap/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233976397,"owners_count":18760044,"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":["42born2code","42cursus","42school","algorithms","c","push-swap","sorting-algorithms","stacks"],"created_at":"2024-11-14T22:30:24.922Z","updated_at":"2025-09-23T12:32:23.460Z","avatar_url":"https://github.com/Ekkoz897.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 42 Push_Swap\n\nBecause swap_push isn't as natural\n\nGiven a set of integers, sort it using a predefined set of instructions using\ntwo stacks. The instruction set is defined below. This program outputs a program\nin push_swap instructions that sorts the input integers.\n\n## Instruction set\n\nFor the following instructions, if the instruction is not possible, the part of\nit that can't be executed won't.\n\n| Code  | Instruction                         | Action                                                 |\n| ----- | ----------------------------------- | ------------------------------------------------------ |\n| `sa`  | swap a                              | swaps the 2 top elements of stack a                    |\n| `sb`  | swap b                              | swaps the 2 top elements of stack b                    |\n| `ss`  | swap a + swap b                     | both `sa` and `sb`                                     |\n| `pa`  | push a                              | moves the top element of stack b at the top of stack a |\n| `pb`  | push b                              | moves the top element of stack a at the top of stack b |\n| `ra`  | rotate a                            | shifts all elements of stack a from bottom to top      |\n| `rb`  | rotate b                            | shifts all elements of stack b from bottom to top      |\n| `rr`  | rotate a + rotate b                 | both `ra` and `rb`                                     |\n| `rra` | reverse rotate a                    | shifts all elements of stack a from top to bottom      |\n| `rrb` | reverse rotate b                    | shifts all elements of stack b from top to bottom      |\n| `rrr` | reverse rotate a + reverse rotate b | both `rra` and `rrb`                                   |\n\n### Bonus\n\nThe bonus part is to write a program named checker, which will get as an argument the stack A formatted as a list of integers. Checker will then wait and read instructions on the standard input. Once all the instructions have been read, checker will execute them on the stack received as an argument (After giving the instructions press ctrl + d).\n\nIf after executing those instructions, stack a is actually sorted and b is empty, then\nchecker must display \"OK\" else \"KO\". If checker arguments are invalid it displays Error.\n\nThe checker code can be found in the bonus_checker folder in this repository.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fekkoz897%2F42cursus_push_swap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fekkoz897%2F42cursus_push_swap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fekkoz897%2F42cursus_push_swap/lists"}