Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
Private Declare Function GetTickCount Lib "kernel32" () As Long
Private Declare Sub InitCommonControls Lib "comctl32" ()
Private Declare Function QueryPerformanceCounter Lib "kernel32" (lpPerformanceCount As Currency) As Long
Private Declare Function QueryPerformanceFrequency Lib "kernel32" (lpFrequency As Currency) As Long
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Type tCell
Age(0 To 1) As Long 'age of cell: this and next generation (alternates)
Neighbors(0 To 1) As Long 'number of living neighbors: this and next generation (alternates)
TopNeighbor As Long 'index to neighbor cell above
LeftNeighbor As Long 'index to neighbor cell left
RightNeighbor As Long 'index to neighbor cell right
BottomNeighbor As Long 'index to neighbor cell below
X As Long 'top left corner of cell on screen
Y As Long
End Type
Private Cells() As tCell 'array of cells
Private CellsAcross As Long
Private CellsDown As Long
Private NumCells As Long 'number of cells
Private CellSize As Long 'size of cell on screen
Private Generation As Long 'generation counter
Private LiveColor As Long
Private DeadColor As Long
Private Seed As Long 'rnd seed
Private PrevTick As Long 'for FpS
Private FPSCount As Long
Private PerfFrq As Currency
Private PerfCnt1 As Currency
Private PerfCnt2 As Currency
Private Paused As Boolean
Private Desc As String 'pattern description
Private Const TooBig As String = "Pattern is too big for this universe."