     rrule = (null for i in [0..15])  
     for i in [0..15]
       rrule[@table[i]] = i      
-    from_list rrule
+    new Rule rrule
         
   ###
   # Checks whether the rule is invertible


    for i in [0...period] by 1
      i1 = (i+1)%period
      from_list compose3( stabilizers[i], @table, stabilizersR[i1] )
      
  #Flashing rule is a rule that converts vacuum to its inverse and back, on each step
  is_flashing:  -> (@table[0] is 15) and (@table[15] is 0)
  
  #Vaccum-stable rules don't change empty field
  is_vacuum_stable: -> @table[0] is 0

    

  (y ^ x for y in [0..15])


list2array =
  if Int8Array?
    (table) -> new Int8Array(table)
  else
    (table) -> table

exports.Rule = class Rule
  constructor: (table) ->
    @table = list2array table
    @validate()
    
  validate: ->
    if @table.length != 16
      throw new Error "Rule must have 16 components"
