summaryrefslogtreecommitdiffstats
path: root/CLI/ruby/lib
diff options
context:
space:
mode:
Diffstat (limited to 'CLI/ruby/lib')
-rw-r--r--CLI/ruby/lib/game_of_life/universe.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/CLI/ruby/lib/game_of_life/universe.rb b/CLI/ruby/lib/game_of_life/universe.rb
index 5b6e29a..5a25b99 100644
--- a/CLI/ruby/lib/game_of_life/universe.rb
+++ b/CLI/ruby/lib/game_of_life/universe.rb
@@ -3,6 +3,7 @@
require "forwardable"
module GameOfLife
+ # Representation of the current and future state of the game of life universe
class Universe
extend Forwardable
delegate :[] => :@current
@@ -35,7 +36,7 @@ module GameOfLife
@future[cell.y][cell.x] = cell.evolve!(neighbors(cell))
end
end
- @current = @future
+ @current = Marshal.load(Marshal.dump(@future))
end
# Return the array of all the neighboring cells using the circular universe array