array-symmetries 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/array.rb +2 -0
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6aee768e03eb2cdf45e0e74164a66a88dfb642c8dbfa3b54325f09ff7307f641
4
- data.tar.gz: fc68f49fbcd61aea66a9b463a460e5bd17b956a0c1022f40f7014577eb8530c3
3
+ metadata.gz: 3ba87b7e100d78700aac96958863b042f5cd05aaca9d25fedcf0e07ebe3ad393
4
+ data.tar.gz: 365c4cfdc9a803b1bb5464b8588167e2643344a18df4865584e86a33b9970629
5
5
  SHA512:
6
- metadata.gz: dd011ee7239ea5b7ac597dc2e8cb30b9cff00568710d1ad14db55ab961900f500247201f68ed190e390f811567b4f3614770fef5b68b9b2ebfbd71c81e884404
7
- data.tar.gz: c377de059ff3fbca68cd7cebe23eb826264300c2f3f7147b59b7959597d6fb8e7310a427671ba96388c48f2f045fd0872708adf3d43d0a0e1fba0a4dd738e3ba
6
+ metadata.gz: '09a286c72391226bc9ef83cfd9f29b4745f5291a90cb40d7f1889de1f57b2566332c65248d438a9fe48ef87a3c8fc664b30f179c6340c4393dc5921baeaba269'
7
+ data.tar.gz: 2f6b743e7c2014c672111f7165633ae936f24723aaa3ad4d70cf88ce3b5c4ee3d0e5ec0f39dbc3a4597f1bab29901a79777b8fcfe428e1180aa00b12958e920d
@@ -32,6 +32,7 @@ class Array # yeah it's a monkey patch
32
32
  [[first.first, first.last], [last.first, last.last]]
33
33
  end
34
34
 
35
+ # Return a square array in which each entry is its own coordinates, i.e. [rol, col]
35
36
  def self.coord_square(n)
36
37
  return ArgumentError unless n.is_a?(Integer) && n > 0
37
38
  Array.new(n) do |i|
@@ -41,6 +42,7 @@ class Array # yeah it's a monkey patch
41
42
  end
42
43
  end
43
44
 
45
+ # Return the array of the eight symmetries of the coordinates square
44
46
  def self.patterns(n)
45
47
  coord_square(n).symmetries
46
48
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: array-symmetries
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lorraine Lee