{"library":"magiccube","title":"MagicCube","description":"MagicCube is a Python library providing an NxNxN Rubik's Cube implementation. It allows for cube manipulation, scrambling, and solving (including Kociemba's algorithm). The current stable version is 1.2.0, with ongoing development reflected in beta releases, though stable releases are less frequent.","language":"python","status":"active","last_verified":"Fri Apr 17","install":{"commands":["pip install magiccube"],"cli":null},"imports":["from magiccube import Cube","from magiccube.cube import Move","from magiccube.solver import KociembaSolver"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"from magiccube import Cube\nfrom magiccube.cube import Move\nfrom magiccube.solver import KociembaSolver\n\n# Create a 3x3x3 cube\nc = Cube(3)\n\n# Scramble the cube\nc.scramble(count=25)\nprint('Scrambled cube:')\nprint(c)\n\n# Get facelet colors in Kociemba format\nkociemba_colors = c.get_kociemba_facelet_colors()\nprint(f'Kociemba facelet colors: {kociemba_colors}')\n\n# Solve the cube using Kociemba's algorithm\nsolver = KociembaSolver(c)\nsolution = solver.solve()\nprint(f'Solution: {solution}')\n\n# Apply the solution to verify\nc.rotate(solution)\nprint('Solved cube:')\nprint(c)\nassert c.is_solved()\n","lang":"python","description":"This quickstart demonstrates how to instantiate a cube, scramble it, retrieve its state in Kociemba format, solve it using the Kociemba solver, and apply the solution.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}