Skip to content

Commit bd73037

Browse files
initial commit
0 parents  commit bd73037

File tree

23 files changed

+2257
-0
lines changed

23 files changed

+2257
-0
lines changed

.github/workflows/ci.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: ["master"]
6+
pull_request:
7+
branches: ["master"]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v3
18+
- name: Build
19+
run: cargo build --verbose
20+
- name: Test
21+
run: cargo test --workspace --lib --verbose
22+
- name: Lint
23+
run: cargo clippy -- -D warnings

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
target

Cargo.lock

+251
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[workspace]
2+
members = ["three-style-lib", "three-style-cli"]

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 LIOKA Ranarison Fiderana
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# three-style
2+
3+
[![Build/test](https://github.com/luckasRanarison/three-style/actions/workflows/ci.yml/badge.svg)](https://github.com/luckasRanarison/three-style/actions/workflows/ci.yml)
4+
[![crates.io](https://img.shields.io/crates/v/three-style)](https://crates.io/crates/three-style)
5+
6+
three-style is a program that searches 3x3 commutators used in 3-style, an advanced method for solving the Rubik's cube blindfolded by swapping 3 pieces at a time without affecting the rest of the cube.
7+
8+
## Contents
9+
10+
- [Installation](#installation)
11+
- [Usage](#usage)
12+
- [Concept](#concept)
13+
- [References](#concept)
14+
- [Contributing](#contributing)
15+
16+
## Installation
17+
18+
You can use three-style by downloading the prebuilt binary for your system from the [releases](https://github.com/luckasRanarison/three-style/releases) or by installing it using cargo:
19+
20+
```bash
21+
cargo install three-style
22+
```
23+
24+
## Usage
25+
26+
three-style uses layers for describing pieces or more precisely sticker targets. Example: `UF` (edge), `UBL` (corner). Currently, it only exposes one main command `search` and is used in the following way:
27+
28+
```bash
29+
three-style search --gen RUD --corners UFR UBL RFD --depth 4
30+
three-style search -g RUD -c UFR UBL RFD -d 4
31+
three-style search --gen RUE --edges UF UB LF --depth 4
32+
three-style search -g RUD -e UF UB LF -d 4
33+
```
34+
35+
> [!NOTE]
36+
> Depth is relative to the length of the commutator in its notation form.
37+
38+
## Concept
39+
40+
A commutator is an algorithm of the form: `A B A' B'` which allows us to swap 3 pieces at once without affecting the rest of the cube. It's commonly described in the following notation: `[A, B]`.
41+
42+
It consists of two basic parts:
43+
44+
- An **interchange** is a single move that swaps two pieces without affecting the third one
45+
- An **insertion** are three moves that insert the third piece into one of the two pieces spot without affecting the other one.
46+
47+
But not all cases can be solved using pure commutators, some cases require using setup moves. A **setup move** is a sequence of moves that turn the case into a case that can be solved using pure commutators. Commutators that use setup moves are of the form `S A B A' B' S'` and are more commonly written as `[S: [A, B]]`
48+
49+
> [!NOTE]
50+
> Edges has a special case called **4 movers** which don't use the normal 3 moves insertion. Example: `[M', U2]`
51+
52+
The program basically does an interative DFS and applies these rules to find commutators. Because these rules allow efficient prunning, search is decently fast.
53+
54+
## References
55+
56+
- [3-style tutorial by Timothy Goh](https://youtu.be/Bq9oz1k5wP4?si=fC3Xi_7j0ehMaepG)
57+
58+
- [Cube explorer](http://kociemba.org/cube.htm)
59+
60+
## Contributing
61+
62+
Bug reports, Pull requests and feature requests are all welcome!

three-style-cli/Cargo.toml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[package]
2+
name = "three-style"
3+
version = "0.1.0"
4+
edition = "2021"
5+
description = "A CLI tool for searching 3x3 Rubiks'cube 3-style commutators"
6+
authors = ["LIOKA Ranraison Fiderana <luckasranarison@gmail.com>"]
7+
repository = "https://github.com/luckasRanarison/three-style"
8+
keywords = ["rubiks-cube", "three-style", "commutators", "algorithms"]
9+
categories = ["algorithms"]
10+
license = "MIT"
11+
readme = "../README.md"
12+
13+
[dependencies]
14+
three-style-lib = { path = "../three-style-lib" }
15+
clap = { version = "4.5.1", features = ["derive", "color"] }

0 commit comments

Comments
 (0)