亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? life.frm

?? 一個用VB開發(fā)的細胞元動機
?? FRM
?? 第 1 頁 / 共 2 頁
字號:
        End If
    Next r
Next c
Call TransferCollections(g_colLive, g_colCouldLive)
Call TransferCollections(g_colDie, g_colCouldDie)
End Sub



Public Sub AddNbrs()
'This function increments the neighbor count of every
'cell adjacent to a cell that has just come to life.
'Cells that might come to life in the next generation
'are added to the nextlive list, and cells that might
'die in the next generation are added to the nextdie
'list. This function leaves the live list empty.

Dim xLow As Integer
Dim xHigh As Integer
Dim yLow As Integer
Dim yHigh As Integer
Dim X As Integer
Dim Y As Integer
Dim c As Integer
Dim r As Integer
Dim tempCell As Cell
Dim index As Long

index = g_colLive.Count
Do While index > 0
    Set tempCell = g_colLive.Item(index)
    c = tempCell.col
    r = tempCell.row
    Call CalcLimits(c, r, xLow, xHigh, yLow, yHigh)
    For Y = yLow To yHigh
        For X = xLow To xHigh
            If (X <> c) Or (Y <> r) Then
                g_iNbrs(Y, X) = g_iNbrs(Y, X) + 1
                Select Case g_iNbrs(Y, X)
                    Case 3
                        If g_iWorld(Y, X) = g_constDead Then
                            Call g_colCouldLive.Add(X, Y)
                        End If
                    Case 4
                        If g_iWorld(Y, X) = g_constAlive Then
                            Call g_colCouldDie.Add(X, Y)
                        End If
                End Select
            End If
        Next X
    Next Y
    index = index - 1
Loop

Call ClearCollection(g_colLive)
Set tempCell = Nothing
End Sub



Public Sub SubNbrs()
'This function decrements the neighbor count of every
'cell adjacent to a cell that has just died. Cells
'that might die in the next generation are added to
'the nextdie list, and cells that might come to life
'in the next generation are added to the nextlive list.
'This function leaves the die list empty.

Dim xLow As Integer
Dim xHigh As Integer
Dim yLow As Integer
Dim yHigh As Integer
Dim X As Integer
Dim Y As Integer
Dim c As Integer
Dim r As Integer
Dim tempCell As Cell
Dim index As Long

index = g_colDie.Count
Do While index > 0
    Set tempCell = g_colDie.Item(index)
    c = tempCell.col
    r = tempCell.row
    Call CalcLimits(c, r, xLow, xHigh, yLow, yHigh)
    For Y = yLow To yHigh
        For X = xLow To xHigh
            If (X <> c) Or (Y <> r) Then
                g_iNbrs(Y, X) = g_iNbrs(Y, X) - 1
                Select Case g_iNbrs(Y, X)
                    Case 1
                        If g_iWorld(Y, X) = g_constAlive Then
                            Call g_colCouldDie.Add(X, Y)
                        End If
                    Case 3
                        If g_iWorld(Y, X) = g_constDead Then
                            Call g_colCouldLive.Add(X, Y)
                        End If
                End Select
            End If
        Next X
    Next Y
    index = index - 1
Loop
Call ClearCollection(g_colDie)
Set tempCell = Nothing
End Sub



Public Sub Live()
'This function scans the live linked list and brings
'to life any cell that fits the requirements for life.
'Cells that come to life are placed back into the live
'list. Cells that don't meet the requirements for life
'are deleted.

Dim tempCell As Cell
Dim r As Integer
Dim c As Integer
Dim index As Long
Dim CenterX As Integer
Dim CenterY As Integer

index = g_colLive.Count
Do While index > 0
    Set tempCell = g_colLive.Item(index)
    c = tempCell.col
    r = tempCell.row
    If (g_iWorld(r, c) = g_constDead) And (g_iNbrs(r, c) = 3) Then
        g_iWorld(r, c) = g_constAlive
        g_iAliveCount = g_iAliveCount + 1
        Call CalcRowCol(c, r, CenterX, CenterY)
        FillColor = g_lAliveCellColor
        ForeColor = g_lAliveCellColor
        Me.Circle (CenterX, CenterY), g_constCircRadius
        index = index - 1
    Else
        g_colLive.Remove (index)
        index = index - 1
    End If
Loop
Set tempCell = Nothing
End Sub



Public Sub Die()
'This function scans the die linked list and kills
'any cell that fits the requirements for death.
'Cells that die are placed back into the die list.
'Cells that don't meet the requirements for death
'are deleted.

Dim tempCell As Cell
Dim r As Integer
Dim c As Integer
Dim index As Long
Dim CenterX As Integer
Dim CenterY As Integer

index = g_colDie.Count
Do While index > 0
    Set tempCell = g_colDie.Item(index)
    c = tempCell.col
    r = tempCell.row
    If ((g_iWorld(r, c) = g_constAlive) And (g_iNbrs(r, c) <> 2) And _
        (g_iNbrs(r, c) <> 3)) Then
        g_iWorld(r, c) = g_constDead
        g_iAliveCount = g_iAliveCount - 1
        FillColor = g_lFormBGColor
        ForeColor = g_lFormBGColor
        Call CalcRowCol(c, r, CenterX, CenterY)
        Me.Circle (CenterX, CenterY), g_constCircRadius
        index = index - 1
    Else
        g_colDie.Remove (index)
        index = index - 1
    End If
Loop
Set tempCell = Nothing
End Sub



Public Sub CalcLimits(ByVal c As Integer, ByVal r As Integer, _
            xLow As Integer, xHigh As Integer, yLow As Integer, _
            yHigh As Integer)
If c = 0 Then
    xLow = 0
Else
    xLow = c - 1
End If

If c = g_iMaxCol - 1 Then
    xHigh = g_iMaxCol - 1
Else
    xHigh = c + 1
End If

If r = 0 Then
    yLow = 0
Else
    yLow = r - 1
End If

If r = g_iMaxRow - 1 Then
    yHigh = g_iMaxRow - 1
Else
    yHigh = r + 1
End If
End Sub



Public Sub ClearCollection(ByRef col As Cells)
'Removes all elements from the collection
Dim index As Long

If col.Count > 0 Then
    For index = col.Count To 1 Step -1
        col.Remove (index)
    Next
End If
End Sub



Public Sub TransferCollections(ByRef DestCol As Cells, _
        ByRef SourceCol As Cells)
'Clears DestCol and copies SourceCol into it
Dim c As Integer
Dim r As Integer
Dim index As Long
Dim tempCell As Cell

If SourceCol.Count > 0 Then
    Call ClearCollection(DestCol)
    For index = 1 To SourceCol.Count
        Set tempCell = SourceCol.Item(index)
        c = tempCell.col
        r = tempCell.row
        Call DestCol.Add(c, r)
    Next
    Call ClearCollection(SourceCol)
End If
End Sub



Public Sub ClearAllCollections()
Call ClearCollection(g_colLive)
Call ClearCollection(g_colDie)
Call ClearCollection(g_colCouldLive)
Call ClearCollection(g_colCouldDie)
End Sub



Public Function CalcRowCol(ByVal col, ByVal row, X, Y)
X = (col * g_iXColWidth) + g_iXMin + (g_iXColWidth / 2)
Y = (row * g_iYRowHeight) + g_iYMin + (g_iYRowHeight / 2)
End Function



Public Sub CalcGrid()
Dim bOK As Boolean
Dim iTemp As Integer

'Start with a uniform 4 pixel spacing
g_iXMin = 4
g_iXMax = Me.ScaleWidth - 4
g_iYMin = Toolbar1.Top + Toolbar1.Height + 4
g_iYMax = Me.ScaleHeight - 4

g_iXColWidth = g_constPreferedCellDim 'Want the cells to be this size
g_iYRowHeight = g_iXColWidth 'Make the cells squares

'Test if columns fit evenly in intitial grid width
Do Until bOK
    iTemp = (g_iXMax - g_iXMin) Mod g_iXColWidth
    If iTemp = 0 Then 'If the columns fit exactly
        bOK = True
    Else 'If the columns don't fit exactly
        If (iTemp Mod 2) = 0 Then 'The remainder is even
            g_iXMin = g_iXMin + (iTemp / 2)
            g_iXMax = g_iXMax - (iTemp / 2)
        Else 'The remainder is odd
            g_iXMin = g_iXMin + 1 'Try adding one pixel to left spacing
        End If
    End If
Loop
bOK = False 'Reset the flag

'Test if rows fit evenly in intitial grid height
Do Until bOK
    iTemp = (g_iYMax - g_iYMin) Mod g_iYRowHeight
    If iTemp = 0 Then 'If the columns fit exactly
        bOK = True
    Else 'If the columns don't fit exactly
        If (iTemp Mod 2) = 0 Then 'The remainder is even
            g_iYMin = g_iYMin + (iTemp / 2)
            g_iYMax = g_iYMax - (iTemp / 2)
        Else 'The remainder is odd
            g_iYMax = g_iYMax - 1 'Try subtracting one pixel from bottom spacing
        End If
    End If
Loop

g_iMaxRow = ((g_iYMax - g_iYMin) / g_iYRowHeight)
g_iMaxCol = ((g_iXMax - g_iXMin) / g_iXColWidth)

ReDim g_iWorld(g_iMaxRow, g_iMaxCol) As Integer
ReDim g_iNbrs(g_iMaxRow, g_iMaxCol) As Integer
End Sub



Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
Dim sMsg As String
Dim result As VbMsgBoxResult
Dim lReturn As Long

Select Case Button.Key
    Case "Start"
        With Button
            If .Caption = "Start" Then
                .Caption = "Stop"
                .Image = "Stop"
                Toolbar1.Buttons("Step").Enabled = False
                Toolbar1.Buttons("Reset").Enabled = False
                Toolbar1.Buttons("Options").Enabled = False
                Toolbar1.Buttons("Quit").Enabled = False
                g_bStarted = True
                g_bGridReset = False
                If g_lGridVisible Then
                    DrawGrid (g_lGridColor)
                Else
                    DrawGrid (g_lFormBGColor)
                End If
                
                Timer1.Interval = g_lInterval
                Timer1.Enabled = True
            Else 'Stop button pressed
                .Caption = "Start"
                .Image = "Start"
                g_bStarted = False
                Timer1.Enabled = False
                Toolbar1.Buttons("Step").Enabled = True
                Toolbar1.Buttons("Reset").Enabled = True
                Toolbar1.Buttons("Options").Enabled = False
                Toolbar1.Buttons("Quit").Enabled = True
            End If
        End With
    Case "Step"
        g_bStarted = True
        Call UpdateLife
    Case "Reset"
        sMsg = "Are you sure you want to clear the grid?"
        result = MsgBox(sMsg, vbYesNo, "Confirm Reset")
        If result = vbNo Then Exit Sub
            
        Call ClearWorld
        g_lGenCount = 0
        g_bGridReset = True
        g_bStarted = False
        DrawGrid (g_lGridColor)
        Toolbar1.Buttons("Start").Caption = "Start"
        Toolbar1.Buttons("Start").Image = "Start"
        Toolbar1.Buttons("Start").Enabled = True
        Toolbar1.Buttons("Step").Enabled = True
        Toolbar1.Buttons("Options").Enabled = True
    Case "Options"
        'Show the Options Dialog Box
        frmOptions.Show 1
            
        'Redraw frmLife Grid and using new color scheme
         Me.BackColor = g_lFormBGColor
         Me.Refresh
         DrawGrid (g_lGridColor)
    Case "Quit"
        Unload Me
    Case "Help"
        Call DoHelp
End Select
End Sub



Public Sub UpdateLife()
Dim sMsg As String
Dim result As VbMsgBoxResult

If g_lGenCount = 0 Then Call CreateLists

Call Live
Call Die
Call AddNbrs
Call SubNbrs
DB1.DigitDisplay = g_iAliveCount
Call TransferCollections(g_colLive, g_colCouldLive)
Call TransferCollections(g_colDie, g_colCouldDie)
g_lGenCount = g_lGenCount + 1
DB2.DigitDisplay = g_lGenCount

If (g_lGenCount = g_lMaxGens) Or (g_bStarted = True And g_iAliveCount = 0) Then
    Timer1.Enabled = False
    
    Toolbar1.Buttons("Start").Enabled = False
    Toolbar1.Buttons("Step").Enabled = False
    Toolbar1.Buttons("Reset").Enabled = True
    Toolbar1.Buttons("Quit").Enabled = True
    
    g_lGenCount = 0
    g_bStarted = False
    If g_iAliveCount = 0 Then
        sMsg = "The world is anihilated!" & vbCrLf _
                & "Press Reset to create a new world."
        result = MsgBox(sMsg, vbOKOnly, "World Status")
    End If
End If
End Sub


Public Sub ResetScreen()
Call GetSettings
Call CalcGrid
Me.BackColor = g_lFormBGColor
Me.ForeColor = g_lAliveCellColor
Call DrawGrid(g_lGridColor)
Call ClearWorld
End Sub


Public Sub PlaceCellRange(ByVal iEndX As Integer, ByVal iEndY As Integer, ByVal iBtnType As Integer)
Dim XRange As Integer
Dim YRange As Integer
Dim X As Integer
Dim Y As Integer
Dim iStep As Integer

XRange = Abs(iEndX - iStartX) + 1
YRange = Abs(iEndY - iStartY) + 1

If XRange >= YRange Then 'Place horizontal cell range
    If iEndX > iStartX Then
        iStep = 1
    Else
        iStep = -1
    End If
    Y = iStartY
    For X = iStartX To iEndX Step iStep
        Call PlaceCell(X, Y, iBtnType)
    Next X
    'Assign end coords to new starting coords for next point in case shift key still down
    iStartX = iEndX
    iStartY = Y
Else 'Place verticle cell range
    If iEndY > iStartY Then
        iStep = 1
    Else
        iStep = -1
    End If
    X = iStartX
    For Y = iStartY To iEndY Step iStep
        Call PlaceCell(X, Y, iBtnType)
    Next Y
    'Assign end coords to new starting coords for next point in case shift key still down
    iStartX = X
    iStartY = iEndY
End If
End Sub

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品夜夜嗨av一区二区三区| 亚洲色图欧美在线| 蜜桃视频第一区免费观看| 欧美在线视频全部完| 亚洲18色成人| 日韩欧美一区二区免费| 国产乱理伦片在线观看夜一区| 久久综合久久综合九色| 国产高清精品网站| 中文字幕一区二区在线播放| 欧美亚洲综合在线| 日本色综合中文字幕| 精品福利一区二区三区| 成人h精品动漫一区二区三区| 亚洲欧洲www| 欧美精品久久天天躁| 国产在线一区二区综合免费视频| 中文字幕一区日韩精品欧美| 欧美日韩免费观看一区二区三区| 日韩av二区在线播放| 国产欧美日韩亚州综合| 在线观看成人小视频| 久久精品国产澳门| 亚洲欧美在线视频| 制服丝袜av成人在线看| 国产成人aaa| 视频一区二区三区在线| 久久久久久久久久久久久夜| 在线精品亚洲一区二区不卡| 激情综合网最新| 亚洲蜜桃精久久久久久久| 欧美xxxxxxxx| 欧美三级视频在线观看| 国产福利精品导航| 五月婷婷久久综合| 国产精品视频一区二区三区不卡| 欧美日韩国产首页| 丁香亚洲综合激情啪啪综合| 日韩精品电影一区亚洲| 国产精品美女视频| 欧美变态口味重另类| 欧美日韩中文字幕一区二区| 成人午夜视频福利| 美女网站色91| 亚洲不卡一区二区三区| ●精品国产综合乱码久久久久| 欧美一区二区三区视频免费播放| 91免费版在线看| 国产成人精品午夜视频免费| 午夜伊人狠狠久久| 一区二区三区国产精华| 亚洲国产精品成人综合| 精品国产乱码久久久久久蜜臀| 在线观看一区日韩| 91丨porny丨首页| 国产精品一级片在线观看| 日本不卡视频在线观看| 一区二区三区高清不卡| 中文字幕一区二区三中文字幕| 久久久久久久综合日本| 欧美大片在线观看| 91精品婷婷国产综合久久性色| 色噜噜偷拍精品综合在线| 丁香天五香天堂综合| 国产专区欧美精品| 国产麻豆一精品一av一免费| 青青草成人在线观看| 一区二区欧美国产| 1区2区3区欧美| 国产精品久久久久四虎| 国产精品动漫网站| 国产精品免费人成网站| 国产精品人妖ts系列视频| 久久精品亚洲国产奇米99| 久久免费视频一区| 久久综合狠狠综合| 久久人人爽爽爽人久久久| 日韩精品一区二区三区老鸭窝 | 久久精品久久综合| 午夜不卡av免费| 亚洲成a天堂v人片| 亚洲国产成人tv| 五月婷婷综合在线| 奇米一区二区三区| 极品少妇xxxx精品少妇| 韩国精品主播一区二区在线观看 | 国产成人综合在线| 国产成人综合亚洲网站| 不卡一区中文字幕| 在线观看日韩精品| 欧美一卡在线观看| 久久亚洲精品国产精品紫薇| 国产午夜精品福利| 国产精品成人一区二区艾草 | 波多野结衣在线aⅴ中文字幕不卡| 国产精品一区二区黑丝| 99在线视频精品| 日本大香伊一区二区三区| 国产精品系列在线| 一区精品在线播放| 丝袜脚交一区二区| 国产一区三区三区| aaa国产一区| 欧美色图免费看| 精品久久久久久久久久久久久久久 | 亚洲不卡在线观看| 美女mm1313爽爽久久久蜜臀| 久久成人av少妇免费| 成人动漫精品一区二区| 欧美日韩精品免费| 久久久精品黄色| 亚洲国产欧美在线| 精品中文字幕一区二区小辣椒| 成人国产视频在线观看| 欧美手机在线视频| 久久久国产午夜精品| 亚洲激情自拍偷拍| 国产又黄又大久久| 欧美自拍丝袜亚洲| 久久久一区二区| 亚洲综合图片区| 国产乱色国产精品免费视频| 色婷婷狠狠综合| 久久亚洲一级片| 亚洲国产精品久久久久秋霞影院| 久久99精品国产麻豆不卡| 色哟哟精品一区| 国产亚洲美州欧州综合国| 亚洲成人先锋电影| 成人h版在线观看| 日韩免费高清视频| 亚洲一区二区三区中文字幕| 国产精品一区二区91| 欧美精品黑人性xxxx| 136国产福利精品导航| 国产一区二区三区在线观看免费视频 | 中文字幕一区二区三区视频| 天堂va蜜桃一区二区三区| 国产v综合v亚洲欧| 欧美成va人片在线观看| 亚洲一区二区av电影| 北岛玲一区二区三区四区| 欧美成人vps| 日本成人在线一区| 日本高清不卡视频| 一区精品在线播放| 精品一区二区三区在线播放| 欧美日韩高清一区二区| **欧美大码日韩| 国产成人啪午夜精品网站男同| 日韩精品中文字幕一区二区三区 | 久久精品欧美日韩| 裸体健美xxxx欧美裸体表演| 欧美性受xxxx| 亚洲精品免费播放| 99re热这里只有精品视频| 国产欧美日韩久久| 国产精品一区二区视频| 精品国产免费人成在线观看| 极品少妇一区二区三区精品视频 | 国产免费久久精品| 国产激情91久久精品导航| 亚洲精品一线二线三线| 久久国产精品色| 欧美xfplay| 麻豆精品久久精品色综合| 4438成人网| 日韩高清不卡一区二区三区| 7777精品伊人久久久大香线蕉的 | 91精品国产综合久久精品图片| 亚洲综合色在线| 在线观看av一区| 日韩激情一二三区| 这里只有精品视频在线观看| 蜜臀久久99精品久久久画质超高清| 欧美一区二区在线不卡| 九一久久久久久| 久久精品在线免费观看| 成人少妇影院yyyy| 亚洲人成网站影音先锋播放| 色婷婷久久久综合中文字幕| 洋洋av久久久久久久一区| 欧美视频在线一区二区三区| 日日夜夜精品视频免费| 精品国产区一区| 风间由美性色一区二区三区| 日韩毛片高清在线播放| 欧美揉bbbbb揉bbbbb| 免费在线观看日韩欧美| 精品国精品国产尤物美女| 国产精品影视在线| 亚洲免费在线看| 欧美日韩电影在线| 极品少妇一区二区三区精品视频| 国产欧美日韩亚州综合| 欧美在线制服丝袜| 精品一区二区av| 亚洲免费在线看| 欧美大片在线观看| 91啪亚洲精品|