A cross-platform CLI application and library for solving 3x3x3 Rubik's cubes using CFOP (Cross, F2L, OLL, PLL) method, written in C# .NET 9.
- Complete cube manipulation: All 18 standard moves (R, L, U, D, F, B and their inverses/rotations)
- ASCII/Unicode visualization: Clear cube state display with color support
- Unix-style piping: Chain commands for complex operations
- Named cube persistence: Save and reload cube states
- WCA-compliant scrambling: Generate official competition scrambles
- Pattern recognition: Analyze cube state and suggest next moves
- Cross solver: Automated white cross solving with multiple strategies
- .NET 9 SDK or later
- Terminal with Unicode support (for cube display)
git clone https://github.com/Steven-Marshall/rubiks.git
cd rubiks
dotnet build --configuration Releasesudo ln -s $(pwd)/src/RubiksCube.CLI/bin/Release/net9.0/rubiks /usr/local/bin/rubiksCreate a solved cube:
rubiks createApply moves:
rubiks apply "R U R' U'"Display cube state:
rubiks displayChain operations together:
rubiks create | rubiks apply "F R U' R' F'" | rubiks displaySave cube states for later use:
rubiks create mycube
rubiks apply "R U R' U'" mycube
rubiks display mycubeGenerate WCA-compliant scrambles:
rubiks scramble-gen
rubiks create | rubiks apply "$(rubiks scramble-gen)" | rubiks displayAnalyze cube state:
rubiks create | rubiks apply "R U R' F'" | rubiks analyzeWith detailed output:
rubiks analyze mycube --verboseCurrently supports white cross solving:
rubiks solve crossUses standard Singmaster notation:
- Face turns: R (Right), L (Left), U (Up), D (Down), F (Front), B (Back)
- Modifiers: ' (counter-clockwise), 2 (180 degrees)
- Rotations: x (pitch), y (yaw), z (roll)
- Middle slices: M (middle), E (equatorial), S (standing)
- RubiksCube.Core: Business logic and cube operations
- RubiksCube.CLI: Command-line interface
- RubiksCube.Tests: Comprehensive test suite (361 tests)
dotnet build
dotnet test
dotnet run --project src/RubiksCube.CLIrubiks/
├── src/
│ ├── RubiksCube.Core/ # Core library
│ ├── RubiksCube.CLI/ # CLI application
│ └── RubiksCube.Tests/ # Unit tests
├── docs/ # Documentation
└── algorithms/ # Algorithm databases (planned)
- Core cube manipulation and display
- Pattern recognition framework
- White cross solver
- F2L (First Two Layers) solver
- OLL (Orient Last Layer) - 57 cases
- PLL (Permute Last Layer) - 21 cases
- Advanced solving methods (ROUX, ZZ)
- Performance analysis and metrics
Contributions welcome! Please:
- Fork the repository
- Create a feature branch
- Write tests for new functionality
- Ensure all tests pass
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Singmaster notation for standardized move notation
- WCA (World Cube Association) for scrambling standards
- CFOP method pioneers for solving strategies