   #//////////////////////////////////////////////////////////////////////////////
   # Rule analysis
   #//////////////////////////////////////////////////////////////////////////////
+  cells_icon = (value) -> "cellicon icon-cells_#{ value.toString(16) }"
   show_rule_diagram = (rule, element) ->
-      cells_icon = (value) -> "cellicon icon-cells_#{ value.toString(16) }"
       #rule must be array of 1 6 integers
       throw new Error ("Function must be array of 16 elements, not\n" + rule)  unless rule.length is 16
 

      else
        dom.text("Rule has dual transform: ").text(Transforms.getDescription dualTransform[0])
    dom.end()
    
    element.innerHTML = ""
    element.appendChild dom.finalize()

          dom = new DomBuilder
          dom.tag("div").CLASS("pattern-background").append(canv).end()
          dom.tag("ul")
          dom.tag("li").text("Result: ").text(result.resolution).end()            
          dom.tag("li").text("Pattern type: ").text(spaceshipType result.dx, result.dy).end()
          dom.tag("li").text("Population: #{cells.length} cells").end()
          dom.tag("li").text("Period: ").text(result.period ? "unknown").end()
