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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? winmine.cls

?? 一個用vb做的掃雷源馬
?? CLS
?? 第 1 頁 / 共 4 頁
字號:
VERSION 1.0 CLASS
BEGIN
  MultiUse = 0   'False
END
Attribute VB_Name = "clsWinMine"
Attribute VB_Creatable = True
Attribute VB_Exposed = False
'***********************************************************************************'
'                                                                                   '
'   WINMINE: OVERVIEW                                                               '
'   -----------------                                                               '
'                                                                                   '
'   This is a Game Sample Application similar to MineSweeper that ships with        '
'   Windows 3.x \ Windows NT. This project comprises of the following files:        '
'                                                                                   '
'   winmine.cls:    This is a class module that implements the main functionality   '
'                   of different aspects of the game.                               '
'                                                                                   '
'   winmine.frm:    The main display form, that implements the user interface and   '
'                   instantiates an object of the above class.                      '
'                                                                                   '
'   coords.cls:     This is another class module that just implements a (X,Y)       '
'                   co-ordinate pair for wrong mine location markings.              '
'                                                                                   '
'   custdlg.frm:    This is the form that is shown modally when the custom game     '
'                   level is chosen from the Game\Custom menu.                      '
'                                                                                   '
'   instruct.frm:   This is the form that displays the rules and playing            '
'                   instructions when F1 is pressed.                                '
'                                                                                   '
'   about.frm       This is the form that displays info about the author etc.       '
'                                                                                   '
'***********************************************************************************'
Option Explicit

' left mouse button constant used by VB
Private Const LEFT_BUTTON As Byte = 1

' flag indicating empty square
Private Const NONE As Byte = 0
' flag indicating a square with a mine
Private Const MINE As Byte = 243
' flag indicating that square has already been opened
Private Const BEEN As Byte = 244
' flag indicating that square has been marked to be a mine
Private Const FLAGGED As Byte = 2
' flag indicating ambiguous square
Private Const QUESTION As Byte = 1

' Maximum\minimum # of mines, rows and columns
Private Const MIN_MINES As Byte = 10
Private Const MAX_MINES As Byte = 99
Private Const MIN_ROWS As Integer = 8
Private Const MAX_ROWS As Integer = 24
Private Const MIN_COLS As Integer = 8
Private Const MAX_COLS As Integer = 36

' Width of a square in pixels
Private Const mintButtonWidth As Byte = 16
' Height of a square in pixels
Private Const mintButtonHeight As Byte = 16

' Total number of Mines in current game level
Private mbytNumMines As Byte
' Number of squares correctly marked to indicate containing a mine
Private mbytCorrectHits As Byte
' Total number of marked squares (including wrong ones)
Private mbytTotalHits As Byte

' Total number of rows and columns in current game level
Private mintRows As Integer
Private mintCols As Integer

' row and column currently being processed
Private mintRow As Integer
Private mintCol As Integer

' flag indicating that its time for a new game
Public mblnNewGame As Boolean
' flag indicating that a mouse click is currently being processed
Private mblnHitTestBegun As Boolean
' variable to hold the main display form
Private mfrmDisplay As Form

' dynamic 2D array to keep track of which squares contain mines,
' which ones indicate mines surround them, which ones have
'already been opened, etc.
Private mbytMineStatus() As Byte

' dynamic 2D array to keep track of the current marking status of a square
' -- whether it is unmarked, ambiguous, flagged correctly, or incorrectly
Private mbytMarked() As Byte

' dynamic 2D array to keep track of the X and Y co-ords
' of the mbytNumMines mine locations in the minefield
Private mbytMineLocations() As Byte

' A collection of clsCoords objects to hold the
' X and Y co-ords of the squares marked wrongly
' to contain mines
Private mcolWrongLocations As New Collection
'***********************************************************************************'
'                                                                                   '
' Purpose:  Determines which square was clicked and with which mouse button, and    '
'           takes action accordingly. Called from the MouseDown event of the main   '
'           display form.                                                           '
'                                                                                   '
' Inputs:   intButton:  The mouse button clicked (left or right\middle)             '
'           inX:        X co-ordinate of mouse cursor position                      '
'           inY:        Y co-ordinate of mouse cursor position                      '
'                                                                                   '
' Returns:  None                                                                    '
'                                                                                   '
'***********************************************************************************'
Public Sub BeginHitTest(intButton As Integer, intX As Single, intY As Single)
    
    ' If the current game is over, start a new game
    ' when the minefield is clicked
    If mblnNewGame Then
        NewGame
    End If
    
    ' Indicate that a mouse click is currently in progress
    mblnHitTestBegun = True
    
    ' Calculate row and col grid co-ords from mouse co-ords
    intX = Int(intX / mintButtonWidth)
    intY = Int(intY / mintButtonHeight)

    ' abort, if  co-ords lie outside minefield
    If intX >= mintCols Or intY >= mintRows Or intX < 0 Or intY < 0 Then
        Exit Sub
    End If

    ' calculate exact square co-ords from grid co-ords
    mintCol = intX * mintButtonWidth
    mintRow = intY * mintButtonHeight

    ' abort, if square already opened
    If mbytMineStatus(intY, intX) >= BEEN Then Exit Sub

    Dim blnLeftDown As Boolean
    blnLeftDown = (intButton And LEFT_BUTTON) > 0

    ' If left mouse button clicked ...
    If blnLeftDown Then
        
        ' if square already marked, can't open, so abort
        If mbytMarked(intY, intX) >= FLAGGED Then Exit Sub
        
        ' temporarily display image control with appropriate bitmap
        If mbytMarked(intY, intX) = QUESTION Then
            mfrmDisplay.imgPressed.Visible = False
            mfrmDisplay.imgQsPressed.Visible = False
            mfrmDisplay.imgQsPressed.Left = mintCol
            mfrmDisplay.imgQsPressed.TOP = mintRow
            mfrmDisplay.imgQsPressed.Visible = True
        Else
            mfrmDisplay.imgQsPressed.Visible = False
            mfrmDisplay.imgPressed.Visible = False
            mfrmDisplay.imgPressed.Left = mintCol
            mfrmDisplay.imgPressed.TOP = mintRow
            mfrmDisplay.imgPressed.Visible = True
        End If
        
    Else    ' if right mouse button clicked ...
        
        Dim Msg As String
        Dim CRLF As String

        CRLF = Chr$(13) & Chr$(10)
        
        Select Case mbytMarked(intY, intX)
    
            Case NONE:      ' if you run out of squares to mark ...
                            If mbytTotalHits = mbytNumMines Then
                                Msg = "Can't Mark Any More Mines!" & CRLF
                                Msg = Msg & "One or more Mines have been wrongly marked." & CRLF
                                Msg = Msg & "UnMark one or more mines with the right mouse button."
                                    
                                MsgBox Msg, vbCritical, "WinMine: Error!"
                                Exit Sub
                            End If
                                    
                            ' if not marked, display a flag in the square to indicate marking
                            mfrmDisplay.PaintPicture mfrmDisplay.imgFlag, mintCol, mintRow
                            ' increment the total # of squares marked
                            mbytTotalHits = mbytTotalHits + 1

                            ' Update display of mines left
                            mfrmDisplay.lblMinesLeft = "Mines Left : " & mbytNumMines - mbytTotalHits
                            
                            ' if correctly marked ...
                            If mbytMineStatus(intY, intX) = MINE Then
                                mbytCorrectHits = mbytCorrectHits + 1
                                mbytMarked(intY, intX) = FLAGGED
                            Else    ' if wrongly marked ...
                                Dim objCoords As New clsCoords
                                    
                                ' store co-ords of wrong location in a new object
                                objCoords.mintX = intX
                                objCoords.mintY = intY
                                    
                                ' and add it to the collection
                                mcolWrongLocations.Add objCoords
                                
                                ' store the index in the collection, of this wrongly marked square
                                ' in the corresponding element of the mbytMarked array.
                                mbytMarked(intY, intX) = mbytTotalHits - mbytCorrectHits + 2
                            End If
                                
                            ' if all mines were correctly marked ...
                            If mbytCorrectHits = mbytNumMines Then
                                Msg = "Congratulations!" & CRLF
                                Msg = Msg & "You have won." & CRLF
                                
                                MsgBox Msg, vbInformation, "WinMine"
                                
                                ' prepare for new game
                                mblnNewGame = True
                            End If
            
            Case QUESTION:  ' if ambiguously marked, unmark it
                            mbytMarked(intY, intX) = NONE
                            ' and display the original square
                            mfrmDisplay.PaintPicture mfrmDisplay.imgButton, mintCol, mintRow

            Case Else:      ' if previously marked with a flag, mark it as ambiguous now
                            ' and display square with ?
                            mfrmDisplay.PaintPicture mfrmDisplay.imgQuestion, mintCol, mintRow
                            
                            ' Decrement total number of marked squares
                            mbytTotalHits = mbytTotalHits - 1
                                
                            ' Update display of mines left
                            mfrmDisplay.lblMinesLeft = "Mines Left : " & mbytNumMines - mbytTotalHits
                            
                            ' if previously marked square contained a mine...
                            If mbytMineStatus(intY, intX) = MINE Then
                                ' decrement the number of correctly marked squares as well
                                mbytCorrectHits = mbytCorrectHits - 1
                            Else    ' if it is a wrongly marked square ...
                                ' remove this wrongly marked co-ords from corresponding position in the collection
                                mcolWrongLocations.Remove mbytMarked(intY, intX) - 2
                                    
                                Dim intXwm As Integer   ' X co-ord of wrong location
                                Dim intYwm As Integer   ' Y co-ord of wrong location
                                Dim i As Integer        ' Loop counter
                                    
                                ' Update the index of the other wrong co-ords in the collection,
                                ' (that appear after the currently deleted item), in the mbytMarked array.
                                For i = mbytMarked(intY, intX) - 2 To mcolWrongLocations.Count
                                    intXwm = mcolWrongLocations(i).mintX
                                    intYwm = mcolWrongLocations(i).mintY
                                    mbytMarked(intYwm, intXwm) = mbytMarked(intYwm, intXwm) - 1
                                Next
                                    
                            End If

                            mbytMarked(intY, intX) = QUESTION
                
        End Select
    
    End If

End Sub
'***********************************************************************************'
'                                                                                   '
' Purpose:  Determines over which square the mouse curser is when the left mouse    '
'           button is released and takes action accordingly. Called from the        '
'           MouseUp event of the main display form                                  '
'                                                                                   '
' Inputs:   intButton:  The mouse button clicked (left or right\middle)             '
'           inX:        X co-ordinate of mouse cursor position                      '

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产凹凸在线观看一区二区| 欧美日韩精品欧美日韩精品一 | 亚洲成国产人片在线观看| 麻豆专区一区二区三区四区五区| 高清免费成人av| 7777精品伊人久久久大香线蕉经典版下载 | 亚洲欧洲av色图| 久久精品国产澳门| 欧美又粗又大又爽| 国产精品水嫩水嫩| 久久99久久99精品免视看婷婷| 色吊一区二区三区| 国产日产欧产精品推荐色| 日韩二区三区在线观看| 91麻豆国产香蕉久久精品| 亚洲精品在线网站| 免费久久99精品国产| 欧美日韩免费一区二区三区视频| 亚洲欧美在线aaa| 国产成人在线观看| 26uuu久久综合| 精品一区二区在线免费观看| 337p亚洲精品色噜噜| 亚洲精品ww久久久久久p站| 成人黄色a**站在线观看| 久久久久国产精品厨房| 精品综合免费视频观看| 欧美一级高清大全免费观看| 亚洲v日本v欧美v久久精品| 91黄视频在线| 亚洲不卡在线观看| 欧美日韩亚洲综合一区二区三区 | 日韩欧美亚洲国产另类| 偷拍亚洲欧洲综合| 欧美高清视频在线高清观看mv色露露十八| 亚洲女厕所小便bbb| 91在线丨porny丨国产| 国产精品色一区二区三区| 大陆成人av片| 亚洲欧洲日韩一区二区三区| 成人av电影在线网| 一区二区在线观看视频| 欧美日韩视频第一区| 日韩中文字幕91| 欧美大肚乱孕交hd孕妇| 极品少妇xxxx偷拍精品少妇| 久久久久国产精品厨房| 97久久精品人人做人人爽| 亚洲综合另类小说| 欧美一区二区三区在线观看 | 亚洲制服欧美中文字幕中文字幕| 色综合天天性综合| 午夜精品影院在线观看| 精品久久久久久久久久久久包黑料 | 国产成人av电影在线播放| 国产精品国产三级国产aⅴ无密码 国产精品国产三级国产aⅴ原创 | 亚洲欧美国产77777| 欧美午夜电影网| 久久精品国产免费| 欧美激情综合在线| 欧美亚洲一区二区在线| 欧美bbbbb| 国产精品天干天干在观线| 在线观看中文字幕不卡| 激情综合色播五月| 亚洲啪啪综合av一区二区三区| 欧美视频一区二区| 国产一区二区三区在线看麻豆| 国产精品久久久一区麻豆最新章节| 91网站视频在线观看| 日韩电影在线一区二区| 国产免费久久精品| 精品视频一区二区三区免费| 国产中文字幕一区| 亚洲一级片在线观看| 久久久国际精品| 欧美日韩国产系列| 成人av在线一区二区| 日本网站在线观看一区二区三区| 欧美激情综合五月色丁香小说| 欧美久久一二区| 97久久久精品综合88久久| 久久97超碰色| 一区二区三区不卡视频在线观看 | 欧美丝袜丝交足nylons| 国产福利一区在线| 三级成人在线视频| 一区二区三区四区在线免费观看| 久久久精品免费免费| 欧美久久久久久久久| 色综合久久久久| 成熟亚洲日本毛茸茸凸凹| 美国一区二区三区在线播放| 一区二区三区精品| 国产欧美一区视频| 精品国免费一区二区三区| 欧美日韩dvd在线观看| 91原创在线视频| 成人黄色软件下载| 高潮精品一区videoshd| 国内久久精品视频| 麻豆成人综合网| 日本午夜精品一区二区三区电影| 亚洲一区二区五区| 亚洲精品五月天| 亚洲免费观看在线视频| 日韩美女视频一区| 国产精品久久久久永久免费观看 | 国产传媒日韩欧美成人| 久久99精品久久只有精品| 日本aⅴ亚洲精品中文乱码| 午夜精品久久久久久久| 亚洲国产精品一区二区尤物区| 亚洲精选一二三| 亚洲美女视频在线| 亚洲精品中文在线| 亚洲一级二级三级| 午夜精品视频一区| 奇米在线7777在线精品| 蜜桃精品视频在线观看| 蜜臀av一区二区在线免费观看| 青青青伊人色综合久久| 久久精品噜噜噜成人88aⅴ| 久99久精品视频免费观看| 国产综合久久久久影院| 国产福利一区二区三区在线视频| 丁香婷婷综合激情五月色| 成人免费视频视频在线观看免费| 成人免费看的视频| 色综合天天综合给合国产| 欧美群妇大交群中文字幕| 欧美一级免费大片| 久久这里只精品最新地址| 久久九九国产精品| 亚洲丝袜美腿综合| 午夜影院久久久| 精品亚洲成av人在线观看| 国产成人免费高清| 色哦色哦哦色天天综合| 欧美精三区欧美精三区| 精品国产免费视频| 国产日产亚洲精品系列| 亚洲欧美另类图片小说| 美女脱光内衣内裤视频久久网站 | 免费xxxx性欧美18vr| 激情六月婷婷久久| eeuss鲁片一区二区三区| 欧美日韩亚洲综合在线| 久久伊99综合婷婷久久伊| 亚洲欧美日韩系列| 男男视频亚洲欧美| 成人动漫中文字幕| 9191成人精品久久| 欧美国产激情一区二区三区蜜月| 亚洲一区免费观看| 国产精品影音先锋| 欧美日韩成人在线| 国产精品二区一区二区aⅴ污介绍| 亚洲成av人片www| 不卡在线视频中文字幕| 777亚洲妇女| 亚洲视频一区在线观看| 精品影院一区二区久久久| 99精品久久久久久| 久久蜜桃av一区二区天堂| 亚洲一区二区成人在线观看| 国产盗摄视频一区二区三区| 欧美日韩国产精选| 欧美国产日产图区| 久久99热这里只有精品| 欧美在线免费播放| 日本一区二区三区在线不卡| 日韩国产成人精品| 色婷婷久久久亚洲一区二区三区 | 国产精品久久久久久久久免费桃花| 亚洲成人免费av| 日本久久电影网| 国产精品久久毛片| 国产成人综合在线| 日韩精品中文字幕在线不卡尤物 | **性色生活片久久毛片| 精品一区二区三区久久| 91精品视频网| 午夜国产精品影院在线观看| 色综合久久88色综合天天6 | 日韩欧美一区二区视频| 亚洲动漫第一页| 在线观看视频一区二区欧美日韩| 中文字幕av一区二区三区高 | 一区二区三区精品| 不卡的电影网站| 国产精品免费看片| 国产69精品久久777的优势| 精品国产乱码久久久久久1区2区| 青青草伊人久久| 91精品国产美女浴室洗澡无遮挡| 午夜日韩在线电影| 日韩一区二区三区在线观看 | 国产精品香蕉一区二区三区| 精品电影一区二区|