Skip to content

Steven-Marshall/rubiks

Repository files navigation

RubiksCube

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.

Features

  • 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

Installation

Prerequisites

  • .NET 9 SDK or later
  • Terminal with Unicode support (for cube display)

Build from Source

git clone https://github.com/Steven-Marshall/rubiks.git
cd rubiks
dotnet build --configuration Release

Create System-wide Command (Linux/macOS)

sudo ln -s $(pwd)/src/RubiksCube.CLI/bin/Release/net9.0/rubiks /usr/local/bin/rubiks

Usage

Basic Commands

Create a solved cube:

rubiks create

Apply moves:

rubiks apply "R U R' U'"

Display cube state:

rubiks display

Piping Commands

Chain operations together:

rubiks create | rubiks apply "F R U' R' F'" | rubiks display

Named Cubes

Save cube states for later use:

rubiks create mycube
rubiks apply "R U R' U'" mycube
rubiks display mycube

Scrambling

Generate WCA-compliant scrambles:

rubiks scramble-gen
rubiks create | rubiks apply "$(rubiks scramble-gen)" | rubiks display

Pattern Analysis

Analyze cube state:

rubiks create | rubiks apply "R U R' F'" | rubiks analyze

With detailed output:

rubiks analyze mycube --verbose

Solving

Currently supports white cross solving:

rubiks solve cross

Notation

Uses 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)

Architecture

  • RubiksCube.Core: Business logic and cube operations
  • RubiksCube.CLI: Command-line interface
  • RubiksCube.Tests: Comprehensive test suite (361 tests)

Development

Build and Test

dotnet build
dotnet test
dotnet run --project src/RubiksCube.CLI

Project Structure

rubiks/
├── src/
│   ├── RubiksCube.Core/      # Core library
│   ├── RubiksCube.CLI/       # CLI application
│   └── RubiksCube.Tests/     # Unit tests
├── docs/                     # Documentation
└── algorithms/               # Algorithm databases (planned)

Roadmap

  • 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

Contributing

Contributions welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Write tests for new functionality
  4. Ensure all tests pass
  5. Submit a pull request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • Singmaster notation for standardized move notation
  • WCA (World Cube Association) for scrambling standards
  • CFOP method pioneers for solving strategies

About

CLI Rubiks Cube Solver

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages