twisty_puzzles 0.0.42 → 0.0.44

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bec4bd5bfc9bfd1cfc57268c6780b7e82aa319d23a1fedc4100ac9e398a92dc9
4
- data.tar.gz: a2b25561e7f34661c5fffc5b0752fb8d014a7001f09e3d3a25b664e89ec41e63
3
+ metadata.gz: ffa8d3e9fa10fa6df109161c4a01fa692c91efc8fb97e7bed2aa56ac2908567c
4
+ data.tar.gz: dd5a787b446b17389c661bd94ba1748a5b59f854363af84700b1d15a01e42a52
5
5
  SHA512:
6
- metadata.gz: 24b4943047355babeac8d774518bea4ae800552cd6a2d23c737cfd16cb4b3628078614d55e893064a7bec6f87e9987248fccc42ca149d9cc7e9eaf62e8479b22
7
- data.tar.gz: aa40f287e594fc661c785d21895cc50bc21915a361cad72d9c66eb72e415280206f31374fa49f9499b12c4f973e74906545279039d321fcd160efee19feb8b86
6
+ metadata.gz: a8de85065c75acd97e65118017dff15ed1ed6074644be7bda2810f1a770b93675ca24b2cc711af5e8e012513d25f77b35e357df3150c44decec8884cd5d82a52
7
+ data.tar.gz: 611dd329ef834ea1d90b89f29f43af9ee71ee815c6e8dc2851f6ccb47ba1a9238192345d36856a919a090e292660cb0cf242dfcb36e7110fec20c8efdaf7faef
@@ -225,7 +225,8 @@ module TwistyPuzzles
225
225
  face_index = rotation_neighbors.index(self)
226
226
  raise unless face_index
227
227
 
228
- rotation_neighbors[(face_index + rotation.direction.value) % rotation_neighbors.length]
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TwistyPuzzles
4
- VERSION = '0.0.42'
4
+ VERSION = '0.0.44'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twisty_puzzles
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.42
4
+ version: 0.0.44
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bernhard F. Brodowsky