twisty_puzzles 0.0.10 → 0.0.11

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: 7616a5e5bd64a5beb6ea98bed6a6f6bc2dc5ae145491db533e4693cd10d0ff6d
4
- data.tar.gz: 8bc2cd597844fb86f9168c8e368c6bbb01cc34a82598ebef7f5dcb77c1e3713c
3
+ metadata.gz: 0f6166de8734039f856869be9f20b6109c194556094bc281ae3138ada4a1ad27
4
+ data.tar.gz: 6a19cc1ad482ec49831c057d944b9055f70c206882ac618892b0336e8d047e3b
5
5
  SHA512:
6
- metadata.gz: 42c3be051514680426bed25b66ca09b8c420f1423a778db10512c37663c42128136acf6f4e72847bed68d4111e8563ef5eb1cd427883bf2802e072853f1900b0
7
- data.tar.gz: d26d1c98f90f7bbd15474ac45f200a483983daadfae40016e5f9d2f0ca44b20a652e480f8bbfc13d939f904140358a1acc741fcbbb09306f35b51a298f3a9cf1
6
+ metadata.gz: 3ba31f44cb0df6f836d9a9b9908550cd2d6ca0ede672d4784f084b609e1249fd0e8e0f8d6cdc0b09e8faba6a462d49966c698b9d5601a4901aa0ee4eb8bc95c1
7
+ data.tar.gz: 16727e63c37191c99ed1c185c851c8a541c97f110505f2c6ae5eeeabb186c11c35173d35c2441cc8c15318dd88f380656afc04690d5bb4eaa9b359b9a2725de3
@@ -143,7 +143,7 @@ module TwistyPuzzles
143
143
  "Color #{c} cannot be part of the color scheme because it is a reserved color."
144
144
  end
145
145
  end
146
- raise ArgumentError unless face_symbols_to_colors.values.all? { |c| c.is_a?(Symbol) }
146
+ raise ArgumentError unless face_symbols_to_colors.values.all?(Symbol)
147
147
  end
148
148
 
149
149
  def add_missing_mappings(turned_face_symbols_to_colors, chirality_corner_source, unknown_index)
@@ -6,6 +6,7 @@ require 'twisty_puzzles/native'
6
6
 
7
7
  module TwistyPuzzles
8
8
  # Coordinate of a sticker on the cube.
9
+ # rubocop:disable Metrics/ClassLength
9
10
  class Coordinate
10
11
  def self.highest_coordinate(cube_size)
11
12
  cube_size - 1
@@ -121,6 +122,23 @@ module TwistyPuzzles
121
122
  from_indices(face, cube_size, m, m)
122
123
  end
123
124
 
125
+ def self.face(face, cube_size)
126
+ neighbor_a, neighbor_b = face.neighbors[0..1]
127
+ coordinate_range(cube_size).collect_concat do |x|
128
+ coordinate_range(cube_size).map do |y|
129
+ from_face_distances(face, cube_size, neighbor_a => x, neighbor_b => y)
130
+ end
131
+ end
132
+ end
133
+
134
+ def self.layer(face, cube_size)
135
+ face.neighbors.zip(face.neighbors.rotate(1)).collect_concat do |neighbor, next_neighbor|
136
+ coordinate_range(cube_size).map do |i|
137
+ from_face_distances(neighbor, cube_size, face => 0, next_neighbor => i)
138
+ end
139
+ end + self.face(face, cube_size)
140
+ end
141
+
124
142
  def self.edges_outside(face, cube_size)
125
143
  face.neighbors.zip(face.neighbors.rotate(1)).collect_concat do |neighbor, next_neighbor|
126
144
  1.upto(cube_size - 2).map do |i|
@@ -261,6 +279,7 @@ module TwistyPuzzles
261
279
  rots
262
280
  end
263
281
  end
282
+ # rubocop:enable Metrics/ClassLength
264
283
 
265
284
  # Coordinate of a sticker on the Skewb.
266
285
  class SkewbCoordinate
@@ -6,7 +6,7 @@ module TwistyPuzzles
6
6
  class MoveTypeCreator
7
7
  def initialize(capture_keys, move_class)
8
8
  raise TypeError unless move_class.is_a?(Class)
9
- raise TypeError unless capture_keys.all? { |k| k.is_a?(Symbol) }
9
+ raise TypeError unless capture_keys.all?(Symbol)
10
10
 
11
11
  @capture_keys = capture_keys.freeze
12
12
  @move_class = move_class
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TwistyPuzzles
4
- VERSION = '0.0.10'
4
+ VERSION = '0.0.11'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twisty_puzzles
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bernhard F. Brodowsky
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-21 00:00:00.000000000 Z
11
+ date: 2021-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize