       if get_state(col, row) == 'live'
          $("#coord_list").append(col + ", " + row + "\n")
 $(document).ready( () ->
-  ROWS = 50
-  COLUMNS = 75
   create_table("#life", COLUMNS, ROWS)
   index = 0;
   while index < GLIDER_GUN.length

  18, 12
]

RULES =
  "2_live": 'live'
  "3_live": 'live'

set_state = (col, row, state) ->
  $(make_id(col, row)).attr class: state


torus = (col, row) ->
  # Make the universe a torus
  if col > COLUMNS
    col = 1
  else if col < 1
    col = COLUMNS

  if row > ROWS
    row = 1
  else if row < 1
    row = ROWS
  [col, row]

get_state_numeric = (col, row) ->
  # if cell is live returns 1, 0 otherwise
#  [col, row] = torus(col, row)
  if $(make_id(col, row)).hasClass('live')
    1
  else
    0

get_state = (col, row) ->
  ['dead', 'live'][get_state_numeric(col, row)]


toggle = (cell_id) ->
  if $("#control")[0].value == "run"
