conway_deathmatch 0.0.0.6 → 0.1.0.1

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: 8ae468567aa50ce8646421adb6a7265142e4db03
4
- data.tar.gz: 2e1957b0a8026de25c82b5a1d43644b082c27fe0
3
+ metadata.gz: 1ec817b0ebbe212baa79e891508aa3bfaba1998b
4
+ data.tar.gz: 7d83ba811e828012a658ea222a21bf5818bb0636
5
5
  SHA512:
6
- metadata.gz: 3445192d199b5e6d9814214fac8133c3a7ce19ee3bedb097f3c511655720fdd54dc22f98d1573e0566cb7d9724c36d0d02dce1ef3542326b7afc3a5152571e34
7
- data.tar.gz: b513799aaac4c91675e5cd44ed95fb9a852ed6f6f12faf13354ba864c8aa597698899e9aead38bdaadd14d8676095cf83153141c54f70681a63e295d2bd04f12
6
+ metadata.gz: c14fc7490abed86aca69a95b50c5205becf541b15bbcf53e2d1678b7c1ff82b751aa5a083f867de4d833c21cd9605b31f8d4150a07fd323b00f5fe01590d5022
7
+ data.tar.gz: eeccd888a4c1d73621259e7cf11e540de2cd8c0f036e69dc8b3b309ab2fcc7f0599b9426d9956cc78d264a2b40dc2a85f383b7cbbb9cc6d0870d5d431f6ff26f
@@ -33,7 +33,7 @@ render_continuous = (n.nil? or !opts.silent?)
33
33
 
34
34
  # create game
35
35
  #
36
- include ConwayGame
36
+ include ConwayDeathmatch
37
37
  b = BoardState.new(width, height)
38
38
  if opts.multiplayer? or opts[:one] or opts[:two] or opts[:three]
39
39
  b.multiplayer = true
@@ -1,10 +1,10 @@
1
- module ConwayGame; end # create namespace
1
+ module ConwayDeathmatch; end # create namespace
2
2
 
3
3
  # data structure for the board - 2d array
4
4
  # implements standard and multiplayer evaluation
5
5
  # static boundaries are treated as dead
6
6
  #
7
- class ConwayGame::BoardState
7
+ class ConwayDeathmatch::BoardState
8
8
  class BoundsError < RuntimeError; end
9
9
 
10
10
  DEAD = '.'
@@ -36,6 +36,11 @@ class ConwayGame::BoardState
36
36
  end
37
37
  end
38
38
 
39
+ def value(x, y)
40
+ in_bounds!(x,y)
41
+ @state[x][y].dup
42
+ end
43
+
39
44
  def in_bounds?(x, y)
40
45
  @xr.include?(x) and @yr.include?(y)
41
46
  end
@@ -1,7 +1,7 @@
1
1
  require 'conway_deathmatch/board_state'
2
2
  require 'yaml'
3
3
 
4
- module ConwayGame
4
+ module ConwayDeathmatch
5
5
  module Shapes
6
6
  @@known
7
7
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: conway_deathmatch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0.6
4
+ version: 0.1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rick Hull