0)
      If (j &gt; m_lSize) Then
         Exit For
      End If
   Next j
   
   m_iIndex = iNextIndex
   
End Sub

Private Sub Class_Initialize()
   m_lSize = 200
   ReDim m_cells(0 To 1, 0 To m_lSize - 1) As Byte
   m_iIndex = 0
   ' seed the initial state
   m_cells(m_iIndex, m_lSize \ 2) = 1
End Sub


' Evolution of the automata over a small number of generations.
' Regular patterns occur on the right hand side but the sequence
' of items down the centre line has been shown to be
' statistically random