array-symmetries 0.0.4 → 0.0.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fbc4d28f09c3afcbf7f2083a1b0bdc63df0dc532aacfaf6eaa4c8323ce3cf3d2
4
- data.tar.gz: 1cb8690a1d7edc86fc1d9cc9f1ab8f5b96c12e7aa1bd8628937daaf062352e47
3
+ metadata.gz: 6aee768e03eb2cdf45e0e74164a66a88dfb642c8dbfa3b54325f09ff7307f641
4
+ data.tar.gz: fc68f49fbcd61aea66a9b463a460e5bd17b956a0c1022f40f7014577eb8530c3
5
5
  SHA512:
6
- metadata.gz: 32443bea26d0601538fb759e35100101790bca42c5ecd6276dd946e7ad23fd3cf9e8e701a01f0d07788787b931fb5e012d6fb3726fc1e437b0fcd6e5b517a490
7
- data.tar.gz: 786aafeadf97c5af337dbdaab143f48ad6a86739dc85406d3843e9a8c510c7f467458edee32373c87c2376b66d68301e0da9bb28924b12f93b9cd0a9caa23388
6
+ metadata.gz: dd011ee7239ea5b7ac597dc2e8cb30b9cff00568710d1ad14db55ab961900f500247201f68ed190e390f811567b4f3614770fef5b68b9b2ebfbd71c81e884404
7
+ data.tar.gz: c377de059ff3fbca68cd7cebe23eb826264300c2f3f7147b59b7959597d6fb8e7310a427671ba96388c48f2f045fd0872708adf3d43d0a0e1fba0a4dd738e3ba
@@ -31,5 +31,18 @@ class Array # yeah it's a monkey patch
31
31
  raise ArgumentError unless square?
32
32
  [[first.first, first.last], [last.first, last.last]]
33
33
  end
34
+
35
+ def self.coord_square(n)
36
+ return ArgumentError unless n.is_a?(Integer) && n > 0
37
+ Array.new(n) do |i|
38
+ Array.new(n) do |j|
39
+ [i, j]
40
+ end
41
+ end
42
+ end
43
+
44
+ def self.patterns(n)
45
+ coord_square(n).symmetries
46
+ end
34
47
  end
35
48
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: array-symmetries
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lorraine Lee
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-12-16 00:00:00.000000000 Z
11
+ date: 2019-05-10 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: The group of symmetries of the square, applied to Ruby arrays of n elements
14
14
  that are arrays of n elements, for some value of n.
@@ -17,11 +17,12 @@ executables: []
17
17
  extensions: []
18
18
  extra_rdoc_files: []
19
19
  files:
20
- - lib/array-symmetries.rb
20
+ - lib/array.rb
21
21
  homepage: https://gitlab.com/n8chz/array-symmetries
22
22
  licenses:
23
23
  - MIT
24
- metadata: {}
24
+ metadata:
25
+ source_code_uri: https://gitlab.com/n8chz/array-symmetries
25
26
  post_install_message:
26
27
  rdoc_options: []
27
28
  require_paths:
@@ -37,8 +38,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
37
38
  - !ruby/object:Gem::Version
38
39
  version: '0'
39
40
  requirements: []
40
- rubyforge_project:
41
- rubygems_version: 2.7.6
41
+ rubygems_version: 3.0.0.beta3
42
42
  signing_key:
43
43
  specification_version: 4
44
44
  summary: Generate symmetries of a square array.