9格子游戏,基于VB的小游戏源码程序 - vb源码程序 - 谷速源码
下载频道> 资源分类> 编程语言> VB源码> 9格子游戏,基于VB的小游戏源码程序

标题:9格子游戏,基于VB的小游戏源码程序
分享到:

所属分类: VB源码 资源类型: 文件大小: 5.41 KB 上传时间: 2016-01-20 22:34:28 下载次数: 7 资源积分:1分 提 供 者: vb源码代做 20160120103403885
内容:
9格子游戏,基于VB的小游戏源码程序,程序员在编程的过程中可以参考学习使用,希望对IT程序员有用,此源码程序简单易懂、方便阅读,有很好的学习价值!部分
 
代码如下:
VERSION 5.00
Begin VB.Form frmTTT 
   Caption         =   "9格游戏"
   ClientHeight    =   7530
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   8415
   LinkTopic       =   "Form1"
   ScaleHeight     =   7530
   ScaleWidth      =   8415
   Begin VB.TextBox txtTimeLimit 
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   9
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   6480
      TabIndex        =   20
      Top             =   360
      Width           =   950
   End
   Begin VB.CommandButton cmdPlayers 
      Caption         =   "游戏人数"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   9
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   735
      Left            =   1920
      TabIndex        =   13
      Top             =   1080
      Width           =   1335
   End
   Begin VB.Timer tmrTimer 
      Enabled         =   0   'False
      Interval        =   100
      Left            =   240
      Top             =   2160
   End
   Begin VB.CommandButton cmdExit 
      Caption         =   "退出游戏"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   9
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   735
      Left            =   3360
      TabIndex        =   12
      Top             =   1080
      Width           =   1335
   End
   Begin VB.CommandButton cmdNew 
      Caption         =   "开始新游戏"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   9
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   735
      Left            =   480
      TabIndex        =   11
      Top             =   1080
      Width           =   1335
   End
   'Download by http://www.codefans.net
   Begin VB.Frame frmTTT 
      Height          =   3555
      Left            =   840
      TabIndex        =   0
      Top             =   2040
      Width           =   3465
      Begin VB.PictureBox pic9 
         BackColor       =   &H00FFFFFF&
         ForeColor       =   &H000000C0&
         Height          =   1000
         Left            =   2280
         ScaleHeight     =   945
         ScaleWidth      =   945
         TabIndex        =   9
         Top             =   2400
         Width           =   1000
      End
      Begin VB.PictureBox pic8 
         BackColor       =   &H00FFFFFF&
         ForeColor       =   &H000000C0&
         Height          =   1000
         Left            =   1200
         ScaleHeight     =   945
         ScaleWidth      =   945
         TabIndex        =   8
         Top             =   2400
         Width           =   1000
      End
      Begin VB.PictureBox pic7 
         BackColor       =   &H00FFFFFF&
         ForeColor       =   &H000000C0&
         Height          =   1000
         Left            =   120
         ScaleHeight     =   945
         ScaleWidth      =   945
         TabIndex        =   7
         Top             =   2400
         Width           =   1000
      End
      Begin VB.PictureBox pic6 
         BackColor       =   &H00FFFFFF&
         ForeColor       =   &H000000C0&
         Height          =   1000
         Left            =   2280
         ScaleHeight     =   945
         ScaleWidth      =   945
         TabIndex        =   6
         Top             =   1320
         Width           =   1000
      End
      Begin VB.PictureBox pic5 
         BackColor       =   &H00FFFFFF&
         ForeColor       =   &H000000C0&
         Height          =   1000
         Left            =   1200
         ScaleHeight     =   945
         ScaleWidth      =   945
         TabIndex        =   5
         Top             =   1320
         Width           =   1000
      End
      Begin VB.PictureBox pic4 
         BackColor       =   &H00FFFFFF&
         ForeColor       =   &H000000C0&
         Height          =   1000
         Left            =   120
         ScaleHeight     =   945
         ScaleWidth      =   945
         TabIndex        =   4
         Top             =   1320
         Width           =   1000
      End
      Begin VB.PictureBox pic3 
         BackColor       =   &H00FFFFFF&
         ForeColor       =   &H000000C0&
         Height          =   1000
         Left            =   2280
         ScaleHeight     =   945
         ScaleWidth      =   945
         TabIndex        =   3
         Top             =   240
         Width           =   1000
      End
      Begin VB.PictureBox pic2 
         BackColor       =   &H00FFFFFF&
         ForeColor       =   &H000000C0&
         Height          =   1000
         Left            =   1200
         ScaleHeight     =   945
         ScaleWidth      =   945
         TabIndex        =   2
         Top             =   240
         Width           =   1000
      End
      Begin VB.PictureBox pic1 
         BackColor       =   &H00FFFFFF&
         ForeColor       =   &H000000C0&
         Height          =   1000
         Left            =   120
         ScaleHeight     =   945
         ScaleWidth      =   945
         TabIndex        =   1
         Top             =   240
         Width           =   1000
      End
   End
   Begin VB.Label lblTimeLimit 
      Caption         =   "时间: "
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   9
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   5880
      TabIndex        =   19
      Top             =   405
      Width           =   495
   End
   Begin VB.Label lblDraw 
      BeginProperty Font 
         Name            =   "Comic Sans MS"
         Size            =   15.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   735
      Left            =   4920
      TabIndex        =   18
      Top             =   4800
      Width           =   2895
   End
   Begin VB.Label lblO 
      BeginProperty Font 
         Name            =   "Comic Sans MS"
         Size            =   15.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   735
      Left            =   4920
      TabIndex        =   17
      Top             =   3960
      Width           =   2895
   End
   Begin VB.Label lblX 
      BeginProperty Font 
         Name            =   "Comic Sans MS"
         Size            =   15.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   735
      Left            =   4920
      TabIndex        =   16
      Top             =   3120
      Width           =   2895
   End
   Begin VB.Label lblTime 
      BeginProperty Font 
         Name            =   "Comic Sans MS"
         Size            =   15.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   4920
      TabIndex        =   15
      Top             =   2280
      Width           =   2895
   End
   Begin VB.Label lblPlayers 
      BeginProperty Font 
         Name            =   "Comic Sans MS"
         Size            =   15.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   4920
      TabIndex        =   14
      Top             =   1320
      Width           =   3255
   End
   Begin VB.Label lblMesg 
      BeginProperty Font 
         Name            =   "Comic Sans MS"
         Size            =   15.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   1335
      Left            =   840
      TabIndex        =   10
      Top             =   5880
      Width           =   3495
   End
End
Attribute VB_Name = "frmTTT"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim topLeft As Integer
Dim topMiddle As Integer
Dim topRight As Integer
Dim midLeft As Integer
Dim center As Integer
Dim midRight As Integer
Dim bottomLeft As Integer
Dim bottomMiddle As Integer
Dim bottomRight As Integer
 
Dim xScore As Integer
'X赢的次数
Dim oScore As Integer
'O赢的次数
Dim draw As Integer
'平局次数
 
Dim turnTime As Single
'游戏时间
Dim maxTime As Single
'游戏允许的最大时间
 
Dim onePlayer As Boolean
'单人模式则为true
Dim xTurn As Boolean
'如果X's为ture则为true
Dim gameOver As Boolean
'如果游戏结束则为true,除非某一方赢。
 
Dim taken(1 To 9) As Boolean
 
Private Sub cmdExit_Click()
'退出游戏
  End
End Sub
 
Private Sub cmdNew_Click()
  If Val(txtTimeLimit.Text) > 0 Then
    maxTime = Val(txtTimeLimit.Text)
  Else
    txtTimeLimit.Text = maxTime
  End If
  pic1.Cls
  pic2.Cls
  pic3.Cls
  pic4.Cls
  pic5.Cls
  pic6.Cls
  pic7.Cls
  pic8.Cls
  pic9.Cls
  topLeft = 0
  topMiddle = 0
  topRight = 0
  midLeft = 0
  center = 0
  midRight = 0
  bottomLeft = 0
  bottomMiddle = 0
  bottomRight = 0
  xTurn = True
  gameOver = False
  lblMesg = "X下子"
  pic1.FontSize = 8
  pic2.FontSize = 8
  pic3.FontSize = 8
  pic4.FontSize = 8
  pic5.FontSize = 8
  pic6.FontSize = 8
  pic7.FontSize = 8
  pic8.FontSize = 8
  pic9.FontSize = 8
  tmrTimer.Enabled = True
  turnTime = 0
  Dim i As Integer
  For i = 1 To 9
    taken(i) = False
  Next i
End Sub
 
Private Sub cmdPlayers_Click()
  If gameOver And onePlayer Then
    onePlayer = False
    lblPlayers.Caption = "双人游戏"
  ElseIf gameOver Then
    onePlayer = True
    lblPlayers.Caption = "人机游戏"
  End If
End Sub
 
Private Sub Form_Load()
  Randomize
  topLeft = 0
  topMiddle = 0
  topRight = 0
  midLeft = 0
  center = 0
  midRight = 0
  bottomLeft = 0
  bottomMiddle = 0
  bottomRight = 0
  xTurn = True
  gameOver = True
  lblMesg = "开始新游戏"
  lblPlayers.Caption = "人机游戏"
  onePlayer = True
  txtTimeLimit.Text = 5
  maxTime = Val(txtTimeLimit.Text)
  turnTime = 0
  xScore = 0
  oScore = 0
  draw = 0
  lblX.Caption = "X赢: " + Str(xScore)
  lblO.Caption = "O赢: " + Str(oScore)
  lblDraw.Caption = "平局: " + Str(draw)
  Dim i As Integer
  For i = 1 To 9
    taken(i) = False
  Next i
End Sub
 
Private Sub pic1_Click()
  If Not gameOver Then
  If topLeft = 0 Then
    taken(1) = True
    turnTime = 0
    If xTurn Then
      pic1.Print "    ";
      pic1.FontSize = 36
      pic1.Print "X"
      xTurn = False
      topLeft = 1
      If Not TTT Then
        lblMesg = "O下子"
      End If
      If Not gameOver And onePlayer Then
        Call compPlay
      End If
    Else
      pic1.Print "  ";
      pic1.FontSize = 36
      pic1.Print "O"
      xTurn = True
      topLeft = 2
      If Not TTT Then
        lblMesg = "X下子"
      End If
    End If
  End If
  End If
End Sub
 
 
Private Sub pic2_Click()
  If Not gameOver Then
  If topMiddle = 0 Then
    taken(2) = True
    turnTime = 0
    If xTurn Then
      pic2.Print "    ";
      pic2.FontSize = 36
      pic2.Print "X"
      xTurn = False
      topMiddle = 1
      If Not TTT Then
        lblMesg = "O下子"
      End If
      If Not gameOver And onePlayer Then
        Call compPlay
      End If
    Else
      pic2.Print "  ";
      pic2.FontSize = 36
      pic2.Print "O"
      xTurn = True
      topMiddle = 2
      If Not TTT Then
        lblMesg = "X下子"
      End If
    End If
  End If
  End If
End Sub
 
 
Private Sub pic3_Click()
  If Not gameOver Then
  If topRight = 0 Then
    taken(3) = True
    turnTime = 0
    If xTurn Then
      pic3.Print "    ";
      pic3.FontSize = 36
      pic3.Print "X"
      xTurn = False
      topRight = 1
      If Not TTT Then
        lblMesg = "O下子"
      End If
      If Not gameOver And onePlayer Then
        Call compPlay
      End If
    Else
      pic3.Print "  ";
      pic3.FontSize = 36
      pic3.Print "O"
      xTurn = True
      topRight = 2
      If Not TTT Then
        lblMesg = "X下子"
      End If
    End If
  End If
  End If
End Sub
 
 
Private Sub pic4_Click()
  If Not gameOver Then
  If midLeft = 0 Then
    taken(4) = True
    turnTime = 0
    If xTurn Then
      pic4.Print "    ";
      pic4.FontSize = 36
      pic4.Print "X"
      xTurn = False
      midLeft = 1
      If Not TTT Then
        lblMesg = "O下子"
      End If
      If Not gameOver And onePlayer Then
        Call compPlay
      End If
    Else
      pic4.Print "  ";
      pic4.FontSize = 36
      pic4.Print "O"
      xTurn = True
      midLeft = 2
      If Not TTT Then
        lblMesg = "X下子"
      End If
    End If
  End If
  End If
End Sub
 
 
Private Sub pic5_Click()
  If Not gameOver Then
  If center = 0 Then
    taken(5) = True
    turnTime = 0
    If xTurn Then
      pic5.Print "    ";
      pic5.FontSize = 36
      pic5.Print "X"
      xTurn = False
      center = 1
      If Not TTT Then
        lblMesg = "O下子"
      End If
      If Not gameOver And onePlayer Then
        Call compPlay
      End If
    Else
      pic5.Print "  ";
      pic5.FontSize = 36
      pic5.Print "O"
      xTurn = True
      center = 2
      If Not TTT Then
        lblMesg = "X下子"
      End If
    End If
  End If
  End If
End Sub
 
 
Private Sub pic6_Click()
  If Not gameOver Then
  If midRight = 0 Then
    taken(6) = True
    turnTime = 0
    If xTurn Then
      pic6.Print "    ";
      pic6.FontSize = 36
      pic6.Print "X"
      xTurn = False
      midRight = 1
      If Not TTT Then
        lblMesg = "O下子"
      End If
      If Not gameOver And onePlayer Then
        Call compPlay
      End If
    Else
      pic6.Print "  ";
      pic6.FontSize = 36
      pic6.Print "O"
      xTurn = True
      midRight = 2
      If Not TTT Then
        lblMesg = "X下子"
      End If
    End If
  End If
  End If
End Sub
 
 
Private Sub pic7_Click()
  If Not gameOver Then
  If bottomLeft = 0 Then
    taken(7) = True
    turnTime = 0
    If xTurn Then
      pic7.Print "    ";
      pic7.FontSize = 36
      pic7.Print "X"
      xTurn = False
      bottomLeft = 1
      If Not TTT Then
        lblMesg = "O下子"
      End If
      If Not gameOver And onePlayer Then
        Call compPlay
      End If
    Else
      pic7.Print "  ";
      pic7.FontSize = 36
      pic7.Print "O"
      xTurn = True
      bottomLeft = 2
      If Not TTT Then
        lblMesg = "X下子"
      End If
    End If
  End If
  End If
End Sub
 
 
Private Sub pic8_Click()
  If Not gameOver Then
  If bottomMiddle = 0 Then
    taken(8) = True
    turnTime = 0
    If xTurn Then
      pic8.Print "    ";
      pic8.FontSize = 36
      pic8.Print "X"
      xTurn = False
      bottomMiddle = 1
      If Not TTT Then
        lblMesg = "O下子"
      End If
      If Not gameOver And onePlayer Then
        Call compPlay
      End If
    Else
      pic8.Print "  ";
      pic8.FontSize = 36
      pic8.Print "O"
      xTurn = True
      bottomMiddle = 2
      If Not TTT Then
        lblMesg = "X下子"
      End If
    End If
  End If
  End If
End Sub
 
 
Private Sub pic9_Click()
  If Not gameOver Then
  If bottomRight = 0 Then
    taken(9) = True
    turnTime = 0
    If xTurn Then
      pic9.Print "    ";
      pic9.FontSize = 36
      pic9.Print "X"
      xTurn = False
      bottomRight = 1
      If Not TTT Then
        lblMesg = "O下子"
      End If
      If Not gameOver And onePlayer Then
        Call compPlay
      End If
    Else
      pic9.Print "  ";
      pic9.FontSize = 36
      pic9.Print "O"
      xTurn = True
      bottomRight = 2
      If Not TTT Then
        lblMesg = "X下子"
      End If
    End If
  End If
  End If
End Sub
 
Private Function TTT() As Boolean
  If topLeft = 1 _
     And topMiddle = 1 _
     And topRight = 1 _
     Or midLeft = 1 _
     And center = 1 _
     And midRight = 1 _
     Or bottomLeft = 1 _
     And bottomMiddle = 1 _
     And bottomRight = 1 _
     Or topLeft = 1 _
     And midLeft = 1 _
     And bottomLeft = 1 _
     Or topMiddle = 1 _
     And center = 1 _
     And bottomMiddle = 1 _
     Or topRight = 1 _
     And midRight = 1 _
     And bottomRight = 1 _
     Or topLeft = 1 _
     And center = 1 _
     And bottomRight = 1 _
     Or topRight = 1 _
     And center = 1 _
     And bottomLeft = 1 Then
       gameOver = True
       xScore = xScore + 1
       lblX.Caption = "X赢: " + Str(xScore)
       lblMesg.Caption = "X赢!"
  
  ElseIf topLeft = 2 _
     And topMiddle = 2 _
     And topRight = 2 _
     Or midLeft = 2 _
     And center = 2 _
     And midRight = 2 _
     Or bottomLeft = 2 _
     And bottomMiddle = 2 _
     And bottomRight = 2 _
     Or topLeft = 2 _
     And midLeft = 2 _
     And bottomLeft = 2 _
     Or topMiddle = 2 _
     And center = 2 _
     And bottomMiddle = 2 _
     Or topRight = 2 _
     And midRight = 2 _
     And bottomRight = 2 _
     Or topLeft = 2 _
     And center = 2 _
     And bottomRight = 2 _
     Or topRight = 2 _
     And center = 2 _
     And bottomLeft = 2 Then
       gameOver = True
       oScore = oScore + 1
       lblO.Caption = "O赢: " + Str(oScore)
       lblMesg.Caption = "O赢!"
  
  ElseIf allFull Then
     gameOver = True
     lblMesg.Caption = "平局!"
     draw = draw + 1
     lblDraw.Caption = "平局: " + Str(draw)
  End If
  TTT = gameOver
 
End Function
 
Private Function allFull() As Boolean
  If topLeft = 0 _
    Or topMiddle = 0 _
    Or topRight = 0 _
    Or midLeft = 0 _
    Or center = 0 _
    Or midRight = 0 _
    Or bottomLeft = 0 _
    Or bottomMiddle = 0 _
    Or bottomRight = 0 Then
    allFull = False
  Else
    allFull = True
  End If
 
End Function
 
Private Sub compPlay()
  Select Case compWinPosition
    Case 1
      Call pic1_Click
    Case 2
      Call pic2_Click
    Case 3
      Call pic3_Click
    Case 4
      Call pic4_Click
    Case 5
      Call pic5_Click
    Case 6
      Call pic6_Click
    Case 7
      Call pic7_Click
    Case 8
      Call pic8_Click
    Case 9
      Call pic9_Click
    Case 0
    '如果平局
      Dim choice As Integer
      Do
        choice = Int(Rnd * 9) + 1
      Loop Until Not taken(choice)
  
      Select Case choice
        Case 1
          Call pic1_Click
        Case 2
          Call pic2_Click
        Case 3
          Call pic3_Click
        Case 4
          Call pic4_Click
        Case 5
          Call pic5_Click
        Case 6
          Call pic6_Click
        Case 7
          Call pic7_Click
        Case 8
          Call pic8_Click
        Case 9
          Call pic9_Click
      End Select
  End Select
  
  xTurn = True
  If Not gameOver Then
    lblMesg.Caption = "X下子"
  End If
End Sub
 
Private Sub tmrTimer_Timer()
  If Not gameOver Then
    lblTime.Caption = "Time: " + FormatNumber(turnTime, 1)
    turnTime = turnTime + 0.1
  End If
  
  If turnTime >= maxTime Then
    lblTime.Caption = "Time: " + FormatNumber(maxTime, 1)
    gameOver = True
    tmrTimer.Enabled = False
    If xTurn Then
      oScore = oScore + 1
      lblO.Caption = "O赢: " + Str(oScore)
      lblMesg.Caption = "O赢!"
    Else
      xScore = score + 1
      lblX.Caption = "X赢: " + Str(xScore)
      lblMesg.Caption = "X赢!"
    End If
  End If
End Sub
 
Private Function compWinPosition() As Integer
  If topLeft = 0 And (topMiddle = 2 _
    And topRight = 2 _
    Or center = 2 _
    And bottomRight = 2 _
    Or midLeft = 2 _
    And bottomLeft = 2) Then
      compWinPosition = 1
  ElseIf topMiddle = 0 _
    And (topLeft = 2 _
    And topRight = 2 _
    Or center = 2 _
    And bottomMiddle = 2) Then
      compWinPosition = 2
  ElseIf topRight = 0 _
    And (topLeft = 2 _
    And topMiddle = 2 _
    Or bottomLeft = 2 _
    And center = 2 _
    Or midRight = 2 _
    And bottomRight = 2) Then
      compWinPosition = 3
  ElseIf midLeft = 0 _
    And (topLeft = 2 _
    And bottomLeft = 2 _
    Or center = 2 _
    And midRight = 2) Then
      compWinPosition = 4
  ElseIf center = 0 _
    And (topLeft = 2 _
    And bottomRight = 2 _
    Or bottomLeft = 2 _
    And topRight = 2 _
    Or topMiddle = 2 _
    And bottomMiddle = 2 _
    Or midLeft = 2 _
    And midRight = 2) Then
      compWinPosition = 5
  ElseIf midRight = 0 _
    And (topRight = 2 _
    And bottomRight = 2 _
    Or midLeft = 2 _
    And center = 2) Then
      compWinPosition = 6
  ElseIf bottomLeft = 0 _
    And (topLeft = 2 _
    And midLeft = 2 _
    Or center = 2 _
    And topRight = 2 _
    Or bottomMiddle = 2 _
    And bottomRight = 2) Then
      compWinPosition = 7
  ElseIf bottomMiddle = 0 _
    And (topMiddle = 2 _
    And center = 2 _
    Or bottomLeft = 2 _
    And bottomRight = 2) Then
      compWinPosition = 8
  ElseIf bottomRight = 0 _
    And (topLeft = 2 _
    And center = 2 _
    Or topRight = 2 _
    And midRight = 2 _
    Or bottomLeft = 2 _
    And bottomMiddle = 2) Then
      compWinPosition = 9
  Else
    compWinPosition = xWinPosition
  End If
End Function
 
Private Function xWinPosition() As Integer
  If topLeft = 0 _
    And (topMiddle = 1 _
    And topRight = 1 _
    Or center = 1 _
    And bottomRight = 1 _
    Or midLeft = 1 _
    And bottomLeft = 1) Then
      xWinPosition = 1
  ElseIf topMiddle = 0 _
    And (topLeft = 1 _
    And topRight = 1 _
    Or center = 1 _
    And bottomMiddle = 1) Then
      xWinPosition = 2
  ElseIf topRight = 0 _
    And (topLeft = 1 _
    And topMiddle = 1 _
    Or bottomLeft = 1 _
    And center = 1 _
    Or midRight = 1 _
    And bottomRight = 1) Then
      xWinPosition = 3
  ElseIf midLeft = 0 _
    And (topLeft = 1 _
    And bottomLeft = 1 _
    Or center = 1 _
    And midRight = 1) Then
      xWinPosition = 4
  ElseIf center = 0 _
    And (topLeft = 1 _
    And bottomRight = 1 _
    Or bottomLeft = 1 _
    And topRight = 1 _
    Or topMiddle = 1 _
    And bottomMiddle = 1 _
    Or midLeft = 1 _
    And midRight = 1) Then
      xWinPosition = 5
  ElseIf midRight = 0 _
    And (topRight = 1 _
    And bottomRight = 1 _
    Or midLeft = 1 _
    And center = 1) Then
      xWinPosition = 6
  ElseIf bottomLeft = 0 _
    And (topLeft = 1 _
    And midLeft = 1 _
    Or center = 1 _
    And topRight = 1 _
    Or bottomMiddle = 1 _
    And bottomRight = 1) Then
      xWinPosition = 7
  ElseIf bottomMiddle = 0 _
    And (topMiddle = 1 _
    And center = 1 _
    Or bottomLeft = 1 _
    And bottomRight = 1) Then
      xWinPosition = 8
  ElseIf bottomRight = 0 _
    And (topLeft = 1 _
    And center = 1 _
    Or topRight = 1 _
    And midRight = 1 _
    Or bottomLeft = 1 _
    And bottomMiddle = 1) Then
      xWinPosition = 9
  Else
    xWinPosition = 0
  End If
End Function
 

文件列表(点击上边下载按钮,如果是垃圾文件请在下面评价差评或者投诉):

9格子游戏,基于VB的小游戏源码程序/
9格子游戏,基于VB的小游戏源码程序/code/
9格子游戏,基于VB的小游戏源码程序/code/9格游戏/
9格子游戏,基于VB的小游戏源码程序/code/9格游戏/frmTTT.frm
9格子游戏,基于VB的小游戏源码程序/code/9格游戏/ticTacToe.vbp
9格子游戏,基于VB的小游戏源码程序/code/9格游戏/ticTacToe.vbw
9格子游戏,基于VB的小游戏源码程序/谷速说明.txt

关键词: 格子 源码 小游戏

编程语言下载排行

Top_arrow
回到顶部
联系方式| 版权声明| 招聘信息| 广告服务| 银行汇款| 法律顾问| 兼职技术| 付款方式| 关于我们|
网站客服网站客服 程序员兼职招聘 程序员兼职招聘
沪ICP备19040327号-3
公安备案号:沪公网安备 31011802003874号
库纳格流体控制系统(上海)有限公司 版权所有
Copyright © 1999-2014, GUSUCODE.COM, All Rights Reserved