Skip to content

Instantly share code, notes, and snippets.

Created June 30, 2010 01:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/ad89eae9051c5a2c2c17 to your computer and use it in GitHub Desktop.
Save anonymous/ad89eae9051c5a2c2c17 to your computer and use it in GitHub Desktop.
# This is a test file that uses the period-4 glider as a starting life form
require 'game_of_life.rb'
gol = GameOfLife.new
@state = Array.new(21) {|row| Array.new(21) {|cell| 0}}
@state[8][4] = 1
@state[9][5] = 1
@state[10][3] = 1
@state[10][4] = 1
@state[10][5] = 1
gol.state = @state
(1..10).each do
r = gol.evolve
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment