- Add freestyle submodule (1B) - Create HyperTwistIPCProcessManager for external process spawning - Create HyperTwistSolverOracleLibrary with Blueprint wrappers - Add brownan GPL solver standalone build files (1D) - Add cahidenes Python solver wrapper using kociemba (1F) - Update roadmap marking 1B/1D/1F in progress
32 lines
929 B
Python
32 lines
929 B
Python
#!/usr/bin/env python3
|
|
"""
|
|
HyperTwist IPC wrapper for cahidenes rubiks-cube-solver oracle.
|
|
Uses the kociemba package for solving (the original repo's vision module is unused here).
|
|
|
|
Input: 54-character facelet string (UBLFRD order)
|
|
Output: Space-separated WCA move notation
|
|
"""
|
|
import sys
|
|
import kociemba
|
|
|
|
def solve(facelets: str) -> str:
|
|
"""Solve a cube from a facelet string."""
|
|
if len(facelets) != 54:
|
|
print(f"ERROR: Facelet string must be 54 characters, got {len(facelets)}", file=sys.stderr)
|
|
sys.exit(1)
|
|
|
|
try:
|
|
solution = kociemba.solve(facelets)
|
|
return solution
|
|
except Exception as e:
|
|
print(f"ERROR: {e}", file=sys.stderr)
|
|
sys.exit(1)
|
|
|
|
if __name__ == "__main__":
|
|
if len(sys.argv) < 2:
|
|
print("ERROR: No facelet string provided", file=sys.stderr)
|
|
sys.exit(1)
|
|
|
|
facelets = sys.argv[1].strip()
|
|
result = solve(facelets)
|
|
print(result)
|