def run_simulation()
  # seed the random number generator
  srand(15110)                            
  # create a canvas of size 340 X 340
  Canvas.init(340, 340, "Testing_Display")
  # initialize forest matrix randomly
  forest = Array.new(17)         # 17 rows
  for i in 0..16 do
    forest[i] = Array.new(17)  # create 17 columns for each row
    for j in 0..16 do
      forest[i][j] = rand(5) # pick a random tree state (0-4) 
    end
  end
  display(forest)
  100.times {
    sleep(0.1)
    forest = update(forest)
    display(forest)
  }
end

def step_simulation()
  # seed the random number generator
  srand(15110)                            
  # create a canvas of size 340 X 340
  Canvas.init(340, 340, "Testing_Display")
  # initialize forest matrix randomly
  forest = Array.new(17)         # 17 rows
  for i in 0..16 do
    forest[i] = Array.new(17)  # create 17 columns for each row
    for j in 0..16 do
      forest[i][j] = rand(5) # pick a random tree state (0-4) 
    end
  end
  display(forest)
  100.times {
    Readline::readline("Press Enter to continue")
    forest = update(forest)
    display(forest)
  }
end

def run_simulation2()
  # seed the random number generator
  srand(15110)
  # create a canvas of size 340 X 340
  Canvas.init(340, 340, "Testing_Display")
  # initialize forest matrix randomly
  forest = Array.new(17)         # 17 rows
  for i in 0..16 do
    forest[i] = Array.new(17)  # create 17 columns for each row
    for j in 0..16 do
      forest[i][j] = 1 + rand(4)   # random non-fire state
    end
  end
  for i in 0..16 do
    forest[0][i] = 0   # force this cell to be on fire
  end
  display(forest)
  100.times {
    sleep(0.1)
    forest = update(forest)
    display(forest)
  }
end
