twisty_puzzles 0.0.42 → 0.0.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/twisty_puzzles/cube.rb +9 -1
- data/lib/twisty_puzzles/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ffa8d3e9fa10fa6df109161c4a01fa692c91efc8fb97e7bed2aa56ac2908567c
|
4
|
+
data.tar.gz: dd5a787b446b17389c661bd94ba1748a5b59f854363af84700b1d15a01e42a52
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a8de85065c75acd97e65118017dff15ed1ed6074644be7bda2810f1a770b93675ca24b2cc711af5e8e012513d25f77b35e357df3150c44decec8884cd5d82a52
|
7
|
+
data.tar.gz: 611dd329ef834ea1d90b89f29f43af9ee71ee815c6e8dc2851f6ccb47ba1a9238192345d36856a919a090e292660cb0cf242dfcb36e7110fec20c8efdaf7faef
|
data/lib/twisty_puzzles/cube.rb
CHANGED
@@ -225,7 +225,8 @@ module TwistyPuzzles
|
|
225
225
|
face_index = rotation_neighbors.index(self)
|
226
226
|
raise unless face_index
|
227
227
|
|
228
|
-
|
228
|
+
after_rotation_index = face_index + rotation_neighbors.length - rotation.direction.value
|
229
|
+
rotation_neighbors[after_rotation_index % rotation_neighbors.length]
|
229
230
|
end
|
230
231
|
|
231
232
|
def mirror(normal_face)
|
@@ -542,6 +543,13 @@ module TwistyPuzzles
|
|
542
543
|
end
|
543
544
|
end
|
544
545
|
|
546
|
+
# Wings are weird to mirror because the main sticker changes.
|
547
|
+
def mirror(normal_face)
|
548
|
+
mirrored_face_symbols = corresponding_part.faces.map { |f| f.mirror(normal_face) }
|
549
|
+
transformed_face_symbols = mirrored_face_symbols[..-2].reverse + [mirrored_face_symbols[-1]]
|
550
|
+
self.class.for_face_symbols(transformed_face_symbols.map(&:face_symbol))
|
551
|
+
end
|
552
|
+
|
545
553
|
private_class_method :for_corner_face_symbols
|
546
554
|
|
547
555
|
def corresponding_part
|