{"id":22508548,"url":"https://github.com/or18/rubikssolver","last_synced_at":"2025-03-28T00:15:17.401Z","repository":{"id":245688814,"uuid":"818930033","full_name":"or18/RubiksSolver","owner":"or18","description":"Rubik's cube cross, xcross, xxcross, xxxcross, xxxxcross solver, and last layer solver based on xxxxcross solver","archived":false,"fork":false,"pushed_at":"2024-08-10T13:25:26.000Z","size":168,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-02T02:12:59.269Z","etag":null,"topics":["ida-star-algorithm","pypy3","python","rubiks-cube","rubiks-cube-solver","search"],"latest_commit_sha":null,"homepage":"","language":"Python","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/or18.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":"2024-06-23T09:34:27.000Z","updated_at":"2024-12-04T20:03:16.000Z","dependencies_parsed_at":"2024-06-23T13:27:12.946Z","dependency_job_id":"11a69f41-da3b-403c-bea5-22f2831e6754","html_url":"https://github.com/or18/RubiksSolver","commit_stats":null,"previous_names":["or18/rubikssolver"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/or18%2FRubiksSolver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/or18%2FRubiksSolver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/or18%2FRubiksSolver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/or18%2FRubiksSolver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/or18","download_url":"https://codeload.github.com/or18/RubiksSolver/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245944105,"owners_count":20697960,"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":["ida-star-algorithm","pypy3","python","rubiks-cube","rubiks-cube-solver","search"],"created_at":"2024-12-07T01:21:20.970Z","updated_at":"2025-03-28T00:15:17.380Z","avatar_url":"https://github.com/or18.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![HitCount](https://hits.dwyl.com/or18/RubiksSolver.svg?style=flat-square)](http://hits.dwyl.com/or18/RubiksSolver)\n# RubiksSolver\nRubik's cube cross, xcross, xxcross, xxxcross, and xxxxcross solver. Last layer(LL) substep solver, LL solver, and LL+AUF solver based on xxxxcross solver are also available. GUI version is also available.\n\n# Notes\n- GUI version is now available. Check [Google colab notebook](https://colab.research.google.com/github/or18/RubiksSolver/blob/main/RubiksSolverApp.ipynb)\u003cbr\u003eSee the demo video (Click the image).\n\n[![Demo video](https://github.com/user-attachments/assets/f9abe48c-ce4b-4fab-8288-56c2912b0fab)](https://github.com/user-attachments/assets/de2aed71-78bc-4a7b-a822-77c1d1f63285)\n\n- Recommended to run on Google Colaboratory, using GPU or TPU.\n- For the first search, some tables need to be created. These tables take up approximately 1.3 GB of disk space. \n- Memory required \u003c= 1.64 GB \n- For the usage, please check the examples or Detail\n# How to use\n1. Clone this repository and go to the directory\n```sh\ngit clone https://github.com/or18/RubiksSolver.git\ncd RubiksSolver\n```\n2. Create a Python program as shown in the examples, and run\n   \n# For Google colab users\nYou can also start search using PyPy3 in Google Colaboratory. Open a notebook and follow the steps (just copy \u0026 paste, and run).\n1. Download the zip file from https://www.pypy.org/download.html\n```sh\n!wget https://downloads.python.org/pypy/pypy3.10-v7.3.16-linux64.tar.bz2\n```\n2. Unzip the file\n```sh\n!tar -xf pypy3.10-v7.3.16-linux64.tar.bz2\n```\n3. Add path\n```python\nimport os\nos.environ['PATH']+=':/content/pypy3.10-v7.3.16-linux64/bin/'\n```\n4. Clone this repository\n```sh\n!git clone https://github.com/or18/RubiksSolver.git\n```\n5. Go to /content/RubiksSolver\n```sh\ncd /content/RubiksSolver\n```\n6. Create Python file\n```python\n%%writefile test.py\n\nimport RubiksSolver.solver as sv\nimport RubiksSolver.move as mv\n\n#from examples/cross.py\nscramble=\"F2 U L2 F2 D2 U' B2 D2 F2 U' B2 D R F2 D U' B' R' D2 U\"\nscramble=sv.solve_F2L(scramble, \"\", False, False, False, False, 5, True, 1, \"cross\", mv.move_UDLRFB)\n```\n7. Run\n```sh\n!pypy3.10 test.py\n```\n# Detail\n## solve_F2L(scramble, rotation, solve_BL, solve_BR, solve_FR, solve_FL, max_length, full_search, sol_index, name, move_restrict)\n### Applications\nCross, xcross, xxcross, xxxcross, xxxxcross, F2L, multi slotting\n### Notes\n- rotation option: Pre-rotation before search. \n- solve_BL, solve_BR, solve_FR, solve_FL options: solve the F2L slot or not\n- max length: Maximum length of solution\n- full_search option: If True, search for solutions that satisfy the conditions as much as possible. If no solution was found, print `No solution found`. If already solved, print `already solved`. If False, print the solution at the sol_index like `solution  // name No. sol_index`. If the solution was not found, print `// No solution for name`. If already solved, print `// name`. If this option is True, this function always returns False. If this option is False, return the concatenation of the scramble transformed by pre-rotation and the solution. This option can be used like this code.\n```Python\nimport RubiksSolver.solver as sv\nimport RubiksSolver.move as mv\n\n#search solutions for F2L#1 (BL) after solve cross\nscramble=\"F2 U L2 F2 D2 U' B2 D2 F2 U' B2 D R F2 D U' B' R' D2 U\"\nscramble=sv.solve_F2L(scramble, \"\", False, False, False, False, 8, False, 1, \"cross\", mv.move_UDLRFB)\nscramble=sv.solve_F2L(scramble, \"\", True, False, False, False, 7, True, 1, \"F2L#1 (BL)\", mv.move_UDLRFB)\n```\n- move_restrict option: move restriction option. Use pre-defined ones `move_UDLRFB`, `move_URF`, `move_UDRF`, `move_UDR`, `move_URFB`, `move_UR`, or use original one like `move_ULF=['U', 'U2', \"U'\", 'L', 'L2', \"L'\", 'F', 'F2', \"F'\"]`.\n### Examples\n```python\nimport RubiksSolver.solver as sv\nimport RubiksSolver.move as mv\n\n##If you want to search cross solutions less than 7 moves, using all moves,\nscramble=\"F2 U L2 F2 D2 U' B2 D2 F2 U' B2 D R F2 D U' B' R' D2 U\"\nscramble=sv.solve_F2L(scramble, \"\", False, False, False, False, 7, True, 1, \"cross\", mv.move_UDLRFB)\n\n#If you want to search the shortest cross solution, set the full_search option False, and set sol_index 1.\nscramble=\"F2 U L2 F2 D2 U' B2 D2 F2 U' B2 D R F2 D U' B' R' D2 U\"\nscramble=sv.solve_F2L(scramble, \"\", False, False, False, False, 8, False, 1, \"cross\", mv.move_UDLRFB)\n\n#If you want to search solutions for cross in U(White) face, pre-rotation option can be \"z2\" or \"z2 y\", \"x2\", etc.\nscramble=\"F2 U L2 F2 D2 U' B2 D2 F2 U' B2 D R F2 D U' B' R' D2 U\"\nscramble=sv.solve_F2L(scramble, \"z2\", False, False, False, False, 7, True, 1, \"cross\", mv.move_UDLRFB)\n\n#If you want to search solutions for BL-xcross, set solve_BL option True.\nscramble=\"F2 U L2 F2 D2 U' B2 D2 F2 U' B2 D R F2 D U' B' R' D2 U\"\nscramble=sv.solve_F2L(scramble, \"\", True, False, False, False, 9, True, 1, \"xcross\", mv.move_UDLRFB)\n\n#If you want to search solutions for F2L (BL), set solve_BL option True.\nscramble=\"U2 L' B2 L D2 R' B2 L U2 R' F2 R2 U B U L B R2 B2 R'\" #cross solved scramble\nscramble=sv.solve_F2L(scramble, \"\", True, False, False, False, 9, True, 1, \"F2L#1(BL)\", mv.move_UDLRFB)\n\n#If you want to search solutions for BL\u0026FL-xxcross, set solve_BL and solve_FL options True.\nscramble=\"F2 U L2 F2 D2 U' B2 D2 F2 U' B2 D R F2 D U' B' R' D2 U\"\nscramble=sv.solve_F2L(scramble, \"\", True, False, False, True, 11, True, 1, \"xxcross\", mv.move_UDLRFB)\n\n#If you want to search solutions for F2L (BL\u0026FL) multi slotting, set solve_BL and solve_FL options True.\nscramble=\"U2 L' B2 L D2 R' B2 L U2 R' F2 R2 U B U L B R2 B2 R'\" #cross solved scramble\nscramble=sv.solve_F2L(scramble, \"\", True, False, False, True, 11, True, 1, \"F2L#1, 2(BL\u0026FL)\", mv.move_UDLRFB)\n\n#If you want to search solutions for BL\u0026BR\u0026FL-xxxcross, set solve_BL, solve_BR and solve_FL options True.\nscramble=\"F2 U L2 F2 D2 U' B2 D2 F2 U' B2 D R F2 D U' B' R' D2 U\"\nscramble=sv.solve_F2L(scramble, \"\", True, True, False, True, 13, True, 1, \"xxxcross\", mv.move_UDLRFB)\n\n#If you want to search solutions for xxxxcross, set solve_BL, solve_BR, solve_FR and solve_FL options True.\nscramble=\"F2 U L2 F2 D2 U' B2 D2 F2 U' B2 D R F2 D U' B' R' D2 U\"\nscramble=sv.solve_F2L(scramble, \"\", True, True, True, True, 15, True, 1, \"xxxxcross\", mv.move_UDLRFB)\n```\n## solve_LL_substep(scramble, rotation, solve_cp, solve_co, solve_ep, solve_eo, max_length, full_search, sol_index, name, move_restrict)\n### Applications\nOLL, COLL, ZBLS, VHLS, etc.\n### Notes\n- solve_cp option: solve last layer CP or not\n- solve_co option: solve last layer CO or not\n- solve_ep option: solve last layer EP or not\n- solve_eo option: solve last layer EO or not\n- If all four options above are set to True, H perm or AUF can be remained.\n- If all four options above are set to False, it is the same as the xxxxcross solver, but it is recommended to use function `solve_F2L` because the search speed becomes much slower.\n### Examples\n```Python\nimport RubiksSolver.solver as sv\nimport RubiksSolver.move as mv\n\n#If you want to search solutions for OLL, set solve_co and solve_eo options True\nscramble=\"U' F R' F U2 B2 R' B2 R B2 L' B2 L U2 F2\"\nscramble=sv.solve_LL_substep(scramble, \"\", False, True, False, True, 12, True, 1, \"OLL\", mv.move_UDLRFB)\n\n#If you want to search solutions for OLL using only U, R, F faces, set move_restrict mv.move_URF\nscramble=\"U' F R' F U2 B2 R' B2 R B2 L' B2 L U2 F2\"\nscramble=sv.solve_LL_substep(scramble, \"\", False, True, False, True, 12, True, 1, \"OLL\", mv.move_URF)\n\n#If you want to search solutions for OLL using only U, L, F faces, please make array for move_restrict\nscramble=\"U' F R' F U2 B2 R' B2 R B2 L' B2 L U2 F2\"\nmove_ULF=['U', 'U2', \"U'\", 'L', 'L2', \"L'\", 'F', 'F2', \"F'\"]\nscramble=sv.solve_LL_substep(scramble, \"\", False, True, False, True, 12, True, 1, \"OLL\", move_ULF)\n\n#If you want to search solutions for ZBLS or VHLS after solve xxxcross using solve_F2L, set solve_EO option True\nscramble=\"F2 U L2 F2 D2 U' B2 D2 F2 U' B2 D R F2 D U' B' R' D2 U\"\nscramble=sv.solve_F2L(scramble, \"\", True, True, False, True, 13, False, 1, \"xxxcross\", mv.move_UDLRFB)\nscramble=sv.solve_LL_substep(scramble, \"\", False, False, False, True, 12, True, 1, \"ZBLS\", mv.move_UDLRFB)\n```\n## solve_LL(scramble, rotation, max_length, full_search, sol_index, name, move_restrict)\n### Applications\nPLL, ZBLL, 1LLL, last slots+last layer, etc.\n### Notes\n- AUF can be remained\n### Examples\n```Python\nimport RubiksSolver.solver as sv\nimport RubiksSolver.move as mv\n\n#If you want to search solutions for PLL\nscramble=\"R2 U F2 L2 B2 D' B2 L2 F2 U2 R2 U\"\nscramble=sv.solve_LL(scramble, \"\", 14, True, 1, \"PLL\", mv.move_UDLRFB)\n\n#If you want to search solutions for ZBLL using only U, D, R, F faces\nscramble=\"U F' B U' F U F2 D2 B D2 B' L2 B' L2 F2\"\nscramble=sv.solve_LL(scramble, \"\", 14, True, 1, \"ZBLL\", mv.move_UDRF)\n```\n## solve_LL_AUF(scramble, rotation, max_length, full_search, sol_index, name, move_restrict)\n### Applications\nAUF, PLL, ZBLL, 1LLL, etc.\n### Notes\n- All parts solved\n### Examples\n```Python\nimport RubiksSolver.solver as sv\nimport RubiksSolver.move as mv\n\n#If you want to search CFOP solutions\nscramble=\"L' F D2 L2 D2 B2 L' R2 F2 R2 B2 D2 B2 R' U B' U' F' L2 D2 R\"\nscramble=sv.solve_F2L(scramble, \"\", False, False, False, False, 7, False, 1, \"cross\", mv.move_UDLRFB)\nscramble=sv.solve_F2L(scramble, \"\", True, False, False, False, 9, False, 1, \"F2L#1 (BL)\", mv.move_UDLRFB)\nscramble=sv.solve_F2L(scramble, \"\", True, False, False, True, 11, False, 1, \"F2L#2 (FL)\", mv.move_UDLRFB)\nscramble=sv.solve_F2L(scramble, \"\", True, True, False, True, 13, False, 1, \"F2L#3 (BR)\", mv.move_UDLRFB)\nscramble=sv.solve_F2L(scramble, \"\", True, True, True, True, 15, False, 1, \"F2L#4 (FR)\", mv.move_UDLRFB)\nscramble=sv.solve_LL_substep(scramble, \"\", False, True, False, True, 12, False, 1, \"OLL\", mv.move_UDLRFB)\nscramble=sv.solve_LL(scramble, \"\", 14, False, 1, \"PLL\", mv.move_UDLRFB)\nscramble=sv.solve_LL_AUF(scramble, \"\", 1, False, 1, \"AUF\", mv.move_UDLRFB)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2For18%2Frubikssolver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2For18%2Frubikssolver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2For18%2Frubikssolver/lists"}