conway_deathmatch 0.4.0.1 → 0.4.0.3

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: 975e5f0b1449157c3a456fda6dca9bb11178bfa5
4
- data.tar.gz: 4967c6a3e77b3933a087f3e15d87cf68664b12dc
3
+ metadata.gz: c55f0ff917347b974ee425de2f25661dc4ee0364
4
+ data.tar.gz: 326a6784a63cc061b677798fcb92d8ddc0c9b500
5
5
  SHA512:
6
- metadata.gz: 30eef27982bdb7c347def54e5b67cb1aea43d96545621254e55ecc57551f88b3c7071b5813cf2213f56ff337d508ffa9017732d9b5f9bc3f195a7930fb58f4d2
7
- data.tar.gz: 3ab5fbced55739d812ae429d607202eda538c466789610be07a7235904c950ede14aaa891c4de9f21bc2ce98a9e417c212bb6c7b833cd0c7c31ba138267cb928
6
+ metadata.gz: 6c894e1ac6f4cb133e70273b005d950569935f7f95e2078ea5ac1236f9133ce937c4d45911bedaf083de830c8d93b8a5e322fce3a8da59f027c9ce58d935fce7
7
+ data.tar.gz: 5fdecf2a42232cc7e4d2dae02fa4692a4a8783a31824766643b0dc4e1f860bcc04f703555eff33fc6e2ab4e337dfda56797e859e675a347ecaf939a1c79e37bd
data/Rakefile CHANGED
@@ -46,9 +46,23 @@ task :roodi do
46
46
  sh "roodi -config=.roodi.yml lib | tee metrics/roodi"
47
47
  end
48
48
 
49
+ desc "Show current system load"
50
+ task "loadavg" do
51
+ puts File.read "/proc/loadavg"
52
+ end
53
+
49
54
  # this runs against the installed gem lib, not git / filesystem
50
55
  desc "Run ruby-prof on bin/conway_deathmatch (100 ticks)"
51
- task "ruby-prof" do
52
- sh ["ruby-prof -m1 bin/conway_deathmatch -- -n100 -s0 --renderfinal",
56
+ task "ruby-prof" => "loadavg" do
57
+ sh ["ruby-prof -m1 bin/conway_deathmatch",
58
+ "-- -n100 -s0 --renderfinal",
53
59
  "| tee metrics/ruby-prof"].join(' ')
54
60
  end
61
+
62
+ # this runs against the installed gem lib, not git / filesystem
63
+ desc "Run ruby-prof with --exclude-common-cycles"
64
+ task "ruby-prof-exclude" => "ruby-prof" do
65
+ sh ["ruby-prof -m1 --exclude-common-cycles bin/conway_deathmatch",
66
+ "-- -n100 -s0 --renderfinal",
67
+ "| tee metrics/ruby-prof-exclude"].join(' ')
68
+ end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.0.1
1
+ 0.4.0.3
data/bin/proving_ground CHANGED
@@ -83,13 +83,14 @@ loop {
83
83
  points = generate_points(num_points, width, height)
84
84
 
85
85
  # have we seen these points before?
86
- if seen.member?(points.hash)
86
+ hsh = points.hash
87
+ if seen.member? hsh
87
88
  collisions += 1
88
89
  puts "X" * collisions
89
90
  break if collisions > max_c # exit the loop, stop generating points
90
91
  next
91
92
  end
92
- seen << points.hash
93
+ seen << hsh
93
94
 
94
95
  # initialize board with generated shape
95
96
  b = BoardState.new(width, height)
@@ -26,7 +26,9 @@ Gem::Specification.new do |s|
26
26
  s.executables = ['conway_deathmatch']
27
27
  s.add_development_dependency "buildar", "~> 2"
28
28
  s.add_development_dependency "minitest", "~> 5"
29
+ s.add_development_dependency "ruby-prof", "~> 0"
29
30
  # uncomment and set ENV['CODE_COVERAGE']
30
31
  # s.add_development_dependency "simplecov", "~> 0.9.0"
32
+ s.add_runtime_dependency "slop", "~> 3.0"
31
33
  s.required_ruby_version = "~> 2"
32
34
  end
@@ -1,4 +1,3 @@
1
- # require 'lager'
2
1
  module ConwayDeathmatch; end # create namespace
3
2
 
4
3
  # data structure for the board - 2d array
@@ -6,8 +5,6 @@ module ConwayDeathmatch; end # create namespace
6
5
  # static boundaries are treated as dead
7
6
  #
8
7
  class ConwayDeathmatch::BoardState
9
- # extend Lager
10
- # log_to $stderr
11
8
  class BoundsError < RuntimeError; end
12
9
 
13
10
  DEAD = '.'
@@ -27,7 +24,6 @@ class ConwayDeathmatch::BoardState
27
24
  @y_len = y_len
28
25
  @state = self.class.new_state(x_len, y_len)
29
26
  @deathmatch = deathmatch
30
- # @lager = self.class.lager
31
27
  end
32
28
 
33
29
  # Conway's Game of Life transition rules
@@ -92,6 +92,15 @@ c7: # urawizardarry
92
92
  - [5, 4]
93
93
  - [5, 5]
94
94
 
95
+ d7: # A
96
+ - [0, 2]
97
+ - [1, 1]
98
+ - [1, 3]
99
+ - [2, 0]
100
+ - [2, 1]
101
+ - [2, 3]
102
+ - [2, 4]
103
+
95
104
  a8: # A
96
105
  - [0, 2]
97
106
  - [1, 1]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: conway_deathmatch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0.1
4
+ version: 0.4.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rick Hull
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-13 00:00:00.000000000 Z
11
+ date: 2014-12-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: buildar
@@ -38,6 +38,34 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '5'
41
+ - !ruby/object:Gem::Dependency
42
+ name: ruby-prof
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: slop
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '3.0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '3.0'
41
69
  description: Deathmatch
42
70
  email:
43
71
  executables: