rubiks_cube 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CONTRIBUTING.md +9 -0
- data/README.md +54 -26
- data/lib/rubiks_cube/version.rb +1 -1
- data/rubiks_cube.gemspec +2 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 780df255a389a0ab949a87416339f0edd8cac095
|
4
|
+
data.tar.gz: fcabdd29db883d17ddce6a78d6d0dd4457bd55c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a95dfabd9bba259656258734b382e7b2250b4968b8ebff7c7a58bd16289bc0a35ed766a5dc8163ec37bbb06f849168d48a85085e94b454624dcd39aca81a9e93
|
7
|
+
data.tar.gz: 98330d9d23ebcece0023d2e204862876efb3357f7f5aa1e77b4ddb778391e8faa3204a1ca09f39be28da38d4c73f9c55772e020466dd32f0fa65a065b585d557
|
data/CONTRIBUTING.md
CHANGED
@@ -11,3 +11,12 @@ Want to contribute? Awesome! Thank you so much.
|
|
11
11
|
5. Push to the branch (`git push origin my-new-feature`)
|
12
12
|
6. Create new [Pull
|
13
13
|
Request](https://help.github.com/articles/using-pull-requests)
|
14
|
+
|
15
|
+
## Running The Tests
|
16
|
+
|
17
|
+
```bash
|
18
|
+
$ git clone https://github.com/chrishunt/rubiks-cube.git
|
19
|
+
$ cd rubiks-cube
|
20
|
+
$ bundle install
|
21
|
+
$ bundle exec rake
|
22
|
+
```
|
data/README.md
CHANGED
@@ -1,16 +1,39 @@
|
|
1
1
|
# Rubik's Cube
|
2
2
|
|
3
|
+
Solve your Rubik's Cube with an **easy** two-cycle solution
|
4
|
+
|
5
|
+
## Description
|
6
|
+
|
3
7
|
Can you solve the Rubik's Cube? Do you want to learn how? GREAT!
|
4
8
|
|
5
9
|
We will teach you a very simple two-cycle solution for solving the Rubik's
|
6
10
|
Cube. It's so simple that I used this exact solution to solve the cube
|
7
11
|
blindfolded in the [2005 Rubik's World
|
8
|
-
Championship](http://worldcubeassociation.org/results/p.php?i=2005HUNT01)
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
12
|
+
Championship](http://worldcubeassociation.org/results/p.php?i=2005HUNT01) with
|
13
|
+
a time of 5 minutes and 40 seconds. After you've mastered this solution, you
|
14
|
+
will average less than 3 minutes and will have enough understanding to progress
|
15
|
+
to the [Fridrich CFOP](http://en.wikipedia.org/wiki/Fridrich_Method) method -
|
16
|
+
making it possible for 15 second solve times. WOW!
|
17
|
+
|
18
|
+
## Sections
|
19
|
+
|
20
|
+
1. [Usage](#usage)
|
21
|
+
1. [Setting Rubik's Cube State](#setting-rubiks-cube-state)
|
22
|
+
- [Examples](#examples)
|
23
|
+
- [Solved Cube](#solved-cube)
|
24
|
+
- [Slightly Scrambled Cube](#slightly-scrambled-cube)
|
25
|
+
- [Fully Scrambled Cube](#fully-scrambled-cube)
|
26
|
+
1. [Turning a Rubik's Cube](#turning-a-rubiks-cube)
|
27
|
+
1. [Solving a Rubik's Cube](#solving-a-rubiks-cube)
|
28
|
+
- [Two Cycle Solution](#two-cycle-solution)
|
29
|
+
- [How It Works: Permutation](#how-it-works-permutation)
|
30
|
+
- [How It Works: Orientation](#how-it-works-orientation)
|
31
|
+
1. [Algorithms](#algorithms)
|
32
|
+
- [Algorithm Notation](#algorithm-notation)
|
33
|
+
- [M Slice](#m-slice)
|
34
|
+
1. [Installation](#installation)
|
35
|
+
1. [Contributing](#contributing)
|
36
|
+
1. [License](#license)
|
14
37
|
|
15
38
|
## Usage
|
16
39
|
|
@@ -45,11 +68,11 @@ puts solution.pretty
|
|
45
68
|
# ...
|
46
69
|
```
|
47
70
|
|
48
|
-
## Setting Rubik's Cube State
|
71
|
+
## Setting Rubik's Cube State
|
49
72
|
|
50
|
-
If
|
51
|
-
|
52
|
-
|
73
|
+
If you have a scrambled Rubik's Cube sitting in front of you right now, you
|
74
|
+
may not know how to get it back to the solved position. That's OK! We can set
|
75
|
+
the Rubik's Cube state manually and learn how to solve it.
|
53
76
|
|
54
77
|
Describing a cube state may seem complicated at first, but it quickly becomes
|
55
78
|
easy after you've done it a few times.
|
@@ -74,15 +97,15 @@ to help you out.
|
|
74
97
|
|
75
98
|
![](https://raw.github.com/chrishunt/rubiks-cube/master/img/cube_solved.jpg)
|
76
99
|
|
77
|
-
A Rubik's Cube is solved by default
|
78
|
-
state of a solved cube manually so it makes sense.
|
100
|
+
A Rubik's Cube is solved by default.
|
79
101
|
|
80
102
|
```ruby
|
81
103
|
require 'rubiks_cube'
|
82
104
|
|
83
|
-
cube = RubiksCube::Cube.new
|
84
|
-
|
85
|
-
|
105
|
+
cube = RubiksCube::Cube.new
|
106
|
+
|
107
|
+
cube.state
|
108
|
+
#=> "UF UR UB UL FL FR BR BL DF DR DB DL UFL URF UBR ULB DLF DFR DRB DBL"
|
86
109
|
|
87
110
|
cube.solved? #=> true
|
88
111
|
```
|
@@ -91,7 +114,8 @@ cube.solved? #=> true
|
|
91
114
|
|
92
115
|
![](https://raw.github.com/chrishunt/rubiks-cube/master/img/cube_scramble_1.jpg)
|
93
116
|
|
94
|
-
|
117
|
+
Notice our cube is now slightly scrambled. We can start our Rubik's Cube in
|
118
|
+
this state if we like:
|
95
119
|
|
96
120
|
```ruby
|
97
121
|
require 'rubiks_cube'
|
@@ -107,8 +131,10 @@ cube.solved? #=> false
|
|
107
131
|
|
108
132
|
![](https://raw.github.com/chrishunt/rubiks-cube/master/img/cube_scramble_2.jpg)
|
109
133
|
|
110
|
-
|
111
|
-
like
|
134
|
+
And here's a fully scrambled cube. This looks hard to solve. We can start our
|
135
|
+
cube in this state if we like and have the solver tell us a solution.
|
136
|
+
|
137
|
+
Here's the scramble we used to mix the cube if you'd like to try it yourself:
|
112
138
|
|
113
139
|
```
|
114
140
|
U D B2 U B D2 B2 F' R' U2 F U' L2 F L2 B2 L2 R' U R' U' D R2 F2 B2
|
@@ -126,9 +152,10 @@ cube.solved? #=> false
|
|
126
152
|
|
127
153
|
## Turning a Rubik's Cube
|
128
154
|
|
129
|
-
Each Rubik's Cube face (
|
130
|
-
calling the appropriate method on the cube. For
|
131
|
-
the right face twice, the down face once, and the
|
155
|
+
Each Rubik's Cube face ( **L**, **R**, **F**, **B**, **D**, **U** ) can be
|
156
|
+
turned clockwise manually by calling the appropriate method on the cube. For
|
157
|
+
example, if we'd like to turn the right face twice, the down face once, and the
|
158
|
+
back face three times:
|
132
159
|
|
133
160
|
```ruby
|
134
161
|
require 'rubiks_cube'
|
@@ -169,10 +196,10 @@ cube.state
|
|
169
196
|
|
170
197
|
## Solving a Rubik's Cube
|
171
198
|
|
172
|
-
We
|
173
|
-
solution is very inefficient, but wonderful for humans. Using the
|
174
|
-
solution, you can quickly learn how to solve the Rubik's Cube without
|
175
|
-
computer.
|
199
|
+
We've provided a simple two-cycle solution to help you solve the Rubik's Cube.
|
200
|
+
This solution is very inefficient, but wonderful for humans. Using the
|
201
|
+
two-cycle solution, you can quickly learn how to solve the Rubik's Cube without
|
202
|
+
using the computer.
|
176
203
|
|
177
204
|
### Two Cycle Solution
|
178
205
|
|
@@ -224,7 +251,8 @@ setup move.
|
|
224
251
|
|
225
252
|
## Algorithms
|
226
253
|
|
227
|
-
All algorithms can be found in
|
254
|
+
All algorithms can be found in
|
255
|
+
[`RubiksCube::Algorithms`](https://github.com/chrishunt/rubiks-cube/blob/master/lib/rubiks_cube/algorithms.rb)
|
228
256
|
|
229
257
|
### Algorithm Notation
|
230
258
|
|
data/lib/rubiks_cube/version.rb
CHANGED
data/rubiks_cube.gemspec
CHANGED
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.version = RubiksCube::VERSION
|
9
9
|
spec.authors = ['Chris Hunt']
|
10
10
|
spec.email = ['c@chrishunt.co']
|
11
|
-
spec.description = %q{
|
12
|
-
spec.summary = %q{
|
11
|
+
spec.description = %q{Solve your Rubik's Cube with a two-cycle solution}
|
12
|
+
spec.summary = %q{Solve your Rubik's Cube with a two-cycle solution}
|
13
13
|
spec.homepage = 'https://github.com/chrishunt/rubiks-cube'
|
14
14
|
spec.license = 'MIT'
|
15
15
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubiks_cube
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Hunt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-05-
|
11
|
+
date: 2013-05-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -66,7 +66,7 @@ dependencies:
|
|
66
66
|
- - '>='
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
|
-
description:
|
69
|
+
description: Solve your Rubik's Cube with a two-cycle solution
|
70
70
|
email:
|
71
71
|
- c@chrishunt.co
|
72
72
|
executables: []
|
@@ -123,7 +123,7 @@ rubyforge_project:
|
|
123
123
|
rubygems_version: 2.0.3
|
124
124
|
signing_key:
|
125
125
|
specification_version: 4
|
126
|
-
summary:
|
126
|
+
summary: Solve your Rubik's Cube with a two-cycle solution
|
127
127
|
test_files:
|
128
128
|
- spec/rubiks_cube/algorithms_spec.rb
|
129
129
|
- spec/rubiks_cube/cube_spec.rb
|