 
   bArray = strings2array match[1]
   sArray = strings2array match[2]
-  
-  transitionTable = for arr in [bArray, sArray]
-    for s in [0 .. numNeighbors] by 1
-      if s in arr
-        1
-      else
-        0
-  console.log JSON.stringify transitionTable
+
+  return new BinaryTransitionFunc n, m, bArray, sArray
+  
   return (state, sum) ->
-    throw new Error "Bad state: #{state}" if not (state in [0,1])
-    throw new Error "Bad sum: #{sum}" if sum <0 or sum > numNeighbors
     transitionTable[state][sum]
 
 #putRandomBlob = (cells, radius, percent, n, m, appendRewrite)->

      visibleCells.push cell
  console.log "VIsible neighborhood of null: #{visibleCells.length} cells"
  return visibleCells
    
# BxxxSxxx
parseTransitionFunction = (str, n, m) ->
  match = str.match /B([\d\s]+)S([\d\s]+)/
  throw new Error("Bad function string: #{str}") unless match?
  numNeighbors = n*(m-2)
  parseIntChecked = (s)->
    v = parseInt s, 10
    throw new Error("Bad number: #{s}") if Number.isNaN v

            
doSetRule =  ->
  try
    transitionFunc = parseTransitionFunction E('rule-entry').value, tessellation.group.n, tessellation.group.m
  catch e
    alert "Failed to parse function: #{e}"

