{"id":19046292,"url":"https://github.com/abra19/push-swap","last_synced_at":"2025-11-11T18:03:31.621Z","repository":{"id":137940346,"uuid":"354309424","full_name":"Abra19/push-swap","owner":"Abra19","description":"Stack A contains a random number of either positive or negative numbers without any duplicates. B is empty.  The goal is to sort this numbers in ascending order into stack A, using only permitted transactions","archived":false,"fork":false,"pushed_at":"2022-12-19T22:23:50.000Z","size":391,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-21T23:47:57.615Z","etag":null,"topics":["c","sorting-algorithms"],"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/Abra19.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":"2021-04-03T14:14:58.000Z","updated_at":"2023-01-26T12:50:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"c5dcaadb-143e-46bf-ae5a-e9721cd2bb5a","html_url":"https://github.com/Abra19/push-swap","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Abra19/push-swap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Abra19%2Fpush-swap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Abra19%2Fpush-swap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Abra19%2Fpush-swap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Abra19%2Fpush-swap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Abra19","download_url":"https://codeload.github.com/Abra19/push-swap/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Abra19%2Fpush-swap/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":283900033,"owners_count":26913495,"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-11-11T02:00:06.610Z","response_time":65,"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":["c","sorting-algorithms"],"created_at":"2024-11-08T22:54:13.758Z","updated_at":"2025-11-11T18:03:31.605Z","avatar_url":"https://github.com/Abra19.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Push-Swap\n\nWe have 2 stacks named A and B\n### Start \nA contains a random number of either positive or negative numbers without any duplicates. B is empty\n\n### Goal\nSort this numbers in ascending order into stack A\n\n### Authorized operations\n* sa: swap the first 2 elements at the top of stack A\n* sb: swap the first 2 elements at the top of stack B\n* ss: sa and sb at the same time\n* pa: take the first element at the top of B and put it at the top of A\n* pb: take the first element at the top of A and put it at the top of B\n* ra: shift up all elements of stack A by 1: first element becomes the last one\n* rb: shift up all elements of stack B by 1: first element becomes the last one\n* rr: ra and rb at the same time\n* rra: shift down all elements of stack a by 1: last element becomes the first one\n* rrb: shift down all elements of stack b by 1: last element becomes the first one\n* rrr: rra and rrb at the same time\n\n### There are two executables\n- `./push_swap` receive as an argument the stack of integers. Program must display the list of instructions to sort the stack A,\nthe smallest number being at the top\n- `./checker` program check if the list of instructions generate with the program push_swap is actually sorting the stack properly.\nIf after executing those instructions, stack a is actually sorted checker display \"OK\".\nIn other case, checker must display \"KO\" followed\n\n### To get started\n1. Clone git repo: `git clone git@github.com:Abra19/push-swap.git`\n2. Compile: `make all`\n3. Running an executables `./push_swap` and `./checker`  with `-help` option will show possible ways to run the program\n4. Running with 30 random args: \n\n   ```ARG=`ruby -e \"puts (0..30).to_a.shuffle.join(' ')\"` \u0026\u0026 ./push_swap $ARG | ./checker $ARG```\n\n5. Running with visualisation of sorting process:\n\n   ```ARG=`ruby -e \"puts (0..30).to_a.shuffle.join(' ')\"` \u0026\u0026 ./push_swap $ARG | ./checker -m $ARG```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabra19%2Fpush-swap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabra19%2Fpush-swap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabra19%2Fpush-swap/lists"}