gameboard 3.0.0 → 3.1.0

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
  SHA1:
3
- metadata.gz: 1c8e6df5d8715f5d0898234d23edc0417729094d
4
- data.tar.gz: e89ce29f16f49a4f55b8ef2e57d56eaa44403705
3
+ metadata.gz: c69058dab994bf5c71099b639fc8d04e08ed0dbb
4
+ data.tar.gz: 18f2625a97889bc391ba3e25cd71f16487e8fdfa
5
5
  SHA512:
6
- metadata.gz: 36c8119c7f31471c50c2b4a5e982d2cf03876b0304b4487165ee56af1bd437754eb49b2a5ef2783b07a2fa121124c1c178477d9038ab65597ff1791b027a7b1f
7
- data.tar.gz: 12b1f18b37a0af525fbe5599b25428d67b98f21df07f7da6234c4f8a24aa5399e6d067ec457383c3253ac0579d94e1204376b880e4049f1bb42953cc89d42432
6
+ metadata.gz: d872aa7e94b2811b826977755b24731ed122939a401401bc6ac8b45d991867361294471a894d9b1a73c0475566854e8b773ff8590138f1fdee616f98488dec15
7
+ data.tar.gz: e7425984d29c04430920639e48c027e6b38e677ea09c79f5963d8b05c596b914e5ee8d37ab38b8870c192182cd4cfb706360ccaf800e41f3913dda594eb34f40
@@ -338,6 +338,15 @@ module Gameboard
338
338
  end
339
339
  end
340
340
 
341
+ # Public: Set a cells value at a given coordinate
342
+ #
343
+ # coord - A coordinate pair in the form X, Y
344
+ def set_cell(coord, value)
345
+ cell = find_cell(coord)
346
+ raise "Cell Not Found" unless !!cell
347
+ cell.value = value
348
+ end
349
+
341
350
  # Public: Return every column on the gameboard.
342
351
  #
343
352
  # coords: An optional boolean to specify returning an Array of coordinates
@@ -384,6 +393,8 @@ module Gameboard
384
393
  # Internal: Returns the default gameboard cell value
385
394
  attr_reader :cells
386
395
 
396
+ # Internal: return a diagonal array given a starting point and a
397
+ # slope.
387
398
  def get_diagonal(start, coords, slope = true)
388
399
  oper = (slope == true ? :+ : :-)
389
400
  diagonal = (0...height).map do |i|
@@ -1,3 +1,3 @@
1
1
  module Gameboard
2
- VERSION = "3.0.0"
2
+ VERSION = "3.1.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gameboard
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sampson Crowley