life_for_site 0.0.2 → 0.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.
- data/lib/life_for_site.rb +14 -6
- metadata +2 -2
data/lib/life_for_site.rb
CHANGED
@@ -60,6 +60,14 @@ class Life_for_site
|
|
60
60
|
end
|
61
61
|
end
|
62
62
|
|
63
|
+
def game_over()
|
64
|
+
if @life_map == @life_map_change
|
65
|
+
return true
|
66
|
+
else
|
67
|
+
return false
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
63
71
|
def next_step()
|
64
72
|
num = 0
|
65
73
|
(0...@n).each do |i|
|
@@ -74,17 +82,17 @@ class Life_for_site
|
|
74
82
|
end
|
75
83
|
end
|
76
84
|
end
|
77
|
-
if @life_map == @life_map_change
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
end
|
85
|
+
#if @life_map == @life_map_change
|
86
|
+
# puts "\e[H\e[2J"
|
87
|
+
# puts "GAME OVER"
|
88
|
+
# exit
|
89
|
+
#end
|
82
90
|
(0...@n).each do|i|
|
83
91
|
(0...@m).each do|j|
|
84
92
|
@life_map[i][j] = @life_map_change[i][j]
|
85
93
|
end
|
86
94
|
end
|
87
|
-
return @
|
95
|
+
return @life_map_change
|
88
96
|
end
|
89
97
|
|
90
98
|
def start_life(x_size, y_size)
|
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.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-11-
|
12
|
+
date: 2014-11-20 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: this is just a life
|
15
15
|
email: lol.ru.sabj@gmail.com
|