life_for_site 0.0.3 → 0.0.4

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.
Files changed (2) hide show
  1. data/lib/life_for_site.rb +5 -7
  2. metadata +1 -1
data/lib/life_for_site.rb CHANGED
@@ -63,13 +63,16 @@ class Life_for_site
63
63
  def game_over()
64
64
  if @life_map == @life_map_change
65
65
  return true
66
- else
67
- return false
68
66
  end
69
67
  end
70
68
 
71
69
  def next_step()
72
70
  num = 0
71
+ (0...@n).each do|i|
72
+ (0...@m).each do|j|
73
+ @life_map[i][j] = @life_map_change[i][j]
74
+ end
75
+ end
73
76
  (0...@n).each do |i|
74
77
  (0...@m).each do |j|
75
78
  num = neighbors(i,j)
@@ -87,11 +90,6 @@ class Life_for_site
87
90
  # puts "GAME OVER"
88
91
  # exit
89
92
  #end
90
- (0...@n).each do|i|
91
- (0...@m).each do|j|
92
- @life_map[i][j] = @life_map_change[i][j]
93
- end
94
- end
95
93
  return @life_map_change
96
94
  end
97
95
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: life_for_site
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: