⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 猜二十四.frm

📁 一个用VB编写的猜24的小游戏
💻 FRM
📖 第 1 页 / 共 2 页
字号:
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      ForeColor       =   &H80000008&
      Height          =   1455
      Index           =   15
      Left            =   3840
      Picture         =   "猜二十四.frx":D892D
      ScaleHeight     =   1425
      ScaleWidth      =   1065
      TabIndex        =   16
      Top             =   8160
      Width           =   1095
   End
   Begin VB.PictureBox Picture1 
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      ForeColor       =   &H80000008&
      Height          =   1455
      Index           =   14
      Left            =   2400
      Picture         =   "猜二十四.frx":DD997
      ScaleHeight     =   1425
      ScaleWidth      =   1065
      TabIndex        =   15
      Top             =   8160
      Width           =   1095
   End
   Begin VB.PictureBox Picture1 
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      ForeColor       =   &H80000008&
      Height          =   1455
      Index           =   13
      Left            =   3360
      Picture         =   "猜二十四.frx":E2A01
      ScaleHeight     =   1425
      ScaleWidth      =   1065
      TabIndex        =   14
      Top             =   9000
      Width           =   1095
   End
   Begin VB.PictureBox Picture1 
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      ForeColor       =   &H80000008&
      Height          =   1455
      Index           =   12
      Left            =   0
      Picture         =   "猜二十四.frx":E7A6B
      ScaleHeight     =   1425
      ScaleWidth      =   1065
      TabIndex        =   13
      Top             =   6720
      Width           =   1095
   End
   Begin VB.PictureBox Picture1 
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      ForeColor       =   &H80000008&
      Height          =   1455
      Index           =   11
      Left            =   2640
      Picture         =   "猜二十四.frx":ECAD5
      ScaleHeight     =   1425
      ScaleWidth      =   1065
      TabIndex        =   12
      Top             =   8880
      Width           =   1095
   End
   Begin VB.PictureBox Picture1 
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      ForeColor       =   &H80000008&
      Height          =   1455
      Index           =   10
      Left            =   4080
      Picture         =   "猜二十四.frx":F1B3F
      ScaleHeight     =   1425
      ScaleWidth      =   1065
      TabIndex        =   11
      Top             =   8880
      Width           =   1095
   End
   Begin VB.PictureBox Picture1 
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      ForeColor       =   &H80000008&
      Height          =   1455
      Index           =   9
      Left            =   6480
      Picture         =   "猜二十四.frx":F6BA9
      ScaleHeight     =   1425
      ScaleWidth      =   1065
      TabIndex        =   10
      Top             =   7080
      Width           =   1095
   End
   Begin VB.PictureBox Picture1 
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      ForeColor       =   &H80000008&
      Height          =   1455
      Index           =   8
      Left            =   6480
      Picture         =   "猜二十四.frx":FBC13
      ScaleHeight     =   1425
      ScaleWidth      =   1065
      TabIndex        =   9
      Top             =   5400
      Width           =   1095
   End
   Begin VB.PictureBox Picture1 
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      ForeColor       =   &H80000008&
      Height          =   1455
      Index           =   7
      Left            =   5040
      Picture         =   "猜二十四.frx":100C7D
      ScaleHeight     =   1425
      ScaleWidth      =   1065
      TabIndex        =   8
      Top             =   7080
      Width           =   1095
   End
   Begin VB.PictureBox Picture1 
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      ForeColor       =   &H80000008&
      Height          =   1455
      Index           =   6
      Left            =   6000
      Picture         =   "猜二十四.frx":105CE7
      ScaleHeight     =   1425
      ScaleWidth      =   1065
      TabIndex        =   7
      Top             =   5400
      Width           =   1095
   End
   Begin VB.PictureBox Picture1 
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      ForeColor       =   &H80000008&
      Height          =   1455
      Index           =   5
      Left            =   6480
      Picture         =   "猜二十四.frx":10AD51
      ScaleHeight     =   1425
      ScaleWidth      =   1065
      TabIndex        =   6
      Top             =   3720
      Width           =   1095
   End
   Begin VB.PictureBox Picture1 
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      ForeColor       =   &H80000008&
      Height          =   1455
      Index           =   4
      Left            =   5640
      Picture         =   "猜二十四.frx":10FDBB
      ScaleHeight     =   1425
      ScaleWidth      =   1065
      TabIndex        =   5
      Top             =   3840
      Width           =   1095
   End
   Begin VB.PictureBox Picture1 
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      ForeColor       =   &H80000008&
      Height          =   1455
      Index           =   3
      Left            =   6480
      Picture         =   "猜二十四.frx":114E25
      ScaleHeight     =   1425
      ScaleWidth      =   1065
      TabIndex        =   4
      Top             =   1920
      Width           =   1095
   End
   Begin VB.PictureBox Picture1 
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      ForeColor       =   &H80000008&
      Height          =   1455
      Index           =   2
      Left            =   5880
      Picture         =   "猜二十四.frx":119E8F
      ScaleHeight     =   1425
      ScaleWidth      =   1065
      TabIndex        =   3
      Top             =   2520
      Width           =   1095
   End
   Begin VB.PictureBox Picture1 
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      ForeColor       =   &H80000008&
      Height          =   1455
      Index           =   1
      Left            =   6480
      Picture         =   "猜二十四.frx":11EEF9
      ScaleHeight     =   1425
      ScaleWidth      =   1065
      TabIndex        =   2
      Top             =   240
      Width           =   1095
   End
   Begin VB.PictureBox Picture1 
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      ForeColor       =   &H80000008&
      Height          =   1455
      Index           =   0
      Left            =   5280
      Picture         =   "猜二十四.frx":123F63
      ScaleHeight     =   1425
      ScaleWidth      =   1065
      TabIndex        =   1
      Top             =   120
      Width           =   1095
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
20
For i = 0 To 39
 Picture1(i).Visible = False
Next i
Text1.Visible = False
Text1.Text = ""
l = 0
m = 0
n = 0
o = 0
p = 0
q = 0
u = 0
s = 0
t = 0
v = 0
w = 0
x = 0
y = 0
z = 0
X1 = 0
X2 = 0
x3 = 0
x4 = 0
x5 = 0
x6 = 0
x7 = 0
x8 = 0
x9 = 0
x10 = 0
x11 = 0
x12 = 0
X13 = 0
X14 = 0
X15 = 0
X16 = 0
X17 = 0
X18 = 0
X19 = 0
X20 = 0
X21 = 0
X22 = 0
X23 = 0
X24 = 0
X25 = 0
X26 = 0
X27 = 0
x28 = 0
Cls
Dim r(1 To 4) As Single
Randomize
For j = 1 To 4
  Do
  k = Int(11 * Rnd)
  Loop Until k <> 0
   r(j) = k
   For ll = 0 To 3
   If Picture1(k + ll * 10 - 1).Visible = False Then
   Picture1(k + ll * 10 - 1).Visible = True
   l = l + 1
   Select Case l
   Case 1
   Picture1(k + ll * 10 - 1).Top = 300
   Picture1(k + ll * 10 - 1).Left = 250
   Case 2
   Picture1(k + ll * 10 - 1).Top = 300
   Picture1(k + ll * 10 - 1).Left = Me.Width - 1450
   Case 3
   Picture1(k + ll * 10 - 1).Top = 1845
   Picture1(k + ll * 10 - 1).Left = 250
   Case 4
   Picture1(k + ll * 10 - 1).Top = 1845
   Picture1(k + ll * 10 - 1).Left = Me.Width - 1450
   End Select
     Exit For
   End If
   Next ll
  
Next j
For e = 1 To 4

   For f = 1 To 4
     For g = 1 To 4
        For h = 1 To 4
          If e <> f And e <> g And e <> h And f <> g And f <> h And g <> h Then
          a = r(e)
          b = r(f)
          c = r(g)
          d = r(h)
          Else
          GoTo 10
          End If
          
If (a + b) * (c + d) = 24 And n = 0 Then Text1.Text = Text1.Text & "  " & "(" & a & "+" & b & ")" & "×" & "(" & c & "+" & d & ")" & vbCrLf: n = 1
If (a + b) * (c - d) = 24 And m = 0 Then Text1.Text = Text1.Text & "  " & "(" & a & "+" & b & ")" & "×" & "(" & c & "-" & d & ")" & vbCrLf: m = 1
If a + b + c + d = 24 And p = 0 Then Text1.Text = Text1.Text & "  " & a & "+" & b & "+" & c & "+" & d & vbCrLf: p = 1
If a * b * c * d = 24 And q = 0 Then Text1.Text = Text1.Text & "  " & a & "×" & b & "×" & c & "×" & d & vbCrLf: q = 1
If a + b + c - d = 24 And u = 0 Then Text1.Text = Text1.Text & "  " & a & "+" & b & "+" & c & "-" & d & vbCrLf: u = 1
If a + b + c * d = 24 And s = 0 Then Text1.Text = Text1.Text & "  " & a & "+" & b & "+" & c & "×" & d & vbCrLf: s = 1
If a * b * c + d = 24 And t = 0 Then Text1.Text = Text1.Text & "  " & a & "×" & b & "×" & c & "+" & d & vbCrLf: t = 1
If a * b + c * d = 24 And v = 0 Then Text1.Text = Text1.Text & "  " & a & "×" & b & "+" & c & "×" & d & vbCrLf: v = 1
If a + b / c + d = 24 And w = 0 Then Text1.Text = Text1.Text & "  " & a & "+" & b & "÷" & c & "+" & d & vbCrLf: w = 1
If a * b * c - d = 24 And x = 0 Then Text1.Text = Text1.Text & "  " & a & "×" & b & "×" & c & "-" & d & vbCrLf: x = 1
If a + (b + c) * d = 24 And y = 0 Then Text1.Text = Text1.Text & "  " & a & "+" & "(" & b & "+" & c & ")" & "×" & d & vbCrLf: y = 1
If (a + b + c) * d = 24 And z = 0 Then Text1.Text = Text1.Text & "  " & "(" & a & "+" & b & "+" & c & ")" & "×" & d & vbCrLf: z = 1
If a * (b * c + d) = 24 And X1 = 0 Then Text1.Text = Text1.Text & "  " & a & "×" & "(" & b & "×" & c & "+" & d & ")" & vbCrLf: X1 = 1
If a * b * (c + d) = 24 And X2 = 0 Then Text1.Text = Text1.Text & "  " & a & "×" & b & "×" & "(" & c & "+" & d & ")" & vbCrLf: X2 = 1
If a * b - c * d = 24 And x3 = 0 Then Text1.Text = Text1.Text & "  " & a & "×" & b & "-" & c & "×" & d & vbCrLf: x3 = 1
If (a - b) * c - d = 24 And x28 = 0 Then Text1.Text = Text1.Text & "  " & "(" & a & "-" & b & ")" & "×" & c & "-" & d & vbCrLf: x28 = 1
If a * b - c - d = 24 And x4 = 0 Then Text1.Text = Text1.Text & "  " & a & "×" & b & "-" & c & "-" & d & vbCrLf: x4 = 1
If a * b * (c - d) = 24 And x5 = 0 Then Text1.Text = Text1.Text & "  " & a & "×" & b & "×" & "(" & c & "-" & d & ")" & vbCrLf: x5 = 1
If a * (b * c - d) = 24 And x6 = 0 Then Text1.Text = Text1.Text & "  " & a & "×" & "(" & b & "×" & c & "-" & d & ")" & vbCrLf: x6 = 1
If a * (b - c * d) = 24 And x7 = 0 Then Text1.Text = Text1.Text & "  " & a & "×" & "(" & b & "-" & c & "×" & d & ")" & vbCrLf: x7 = 1
If (a - b) * (c - d) = 24 And x8 = 0 Then Text1.Text = Text1.Text & "  " & "(" & a & "-" & b & ")" & "×" & "(" & c & "-" & d & ")" & vbCrLf: x8 = 1
If a * (b + c - d) = 24 And o = 0 Then Text1.Text = Text1.Text & "  " & a & "×" & "(" & b & "+" & c & "-" & d & ")" & vbCrLf: o = 1
If a * (b - c - d) = 24 And x9 = 0 Then Text1.Text = Text1.Text & "  " & a & "×" & "(" & b & "-" & c & "-" & d & ")" & vbCrLf: x9 = 1
If a * b * c / d = 24 And x10 = 0 Then Text1.Text = Text1.Text & "  " & a & "×" & b & "×" & c & "÷" & d & vbCrLf: x10 = 1
If a * b / (c * d) = 24 And x11 = 0 Then Text1.Text = Text1.Text & "  " & a & "×" & b & "÷" & "(" & c & "×" & d & ")" & vbCrLf: x11 = 1
If a + b / c * d = 24 And x12 = 0 Then Text1.Text = Text1.Text & "  " & a & "+" & b & "÷" & c & "×" & d & vbCrLf: x12 = 1
If a + b * (c - d) = 24 And X13 = 0 Then Text1.Text = Text1.Text & "  " & a & "+" & b & "×" & "(" & c & "-" & d & ")" & vbCrLf: X13 = 1
If (a + b * c) / d = 24 And X14 = 0 Then Text1.Text = Text1.Text & "  " & "(" & a & "+" & b & "×" & c & ")" & "÷" & d & vbCrLf: X14 = 1
If (a + b) * c - d = 24 And X15 = 0 Then Text1.Text = Text1.Text & "  " & "(" & a & "+" & b & ")" & "×" & c & "-" & d & vbCrLf: X15 = 1
If (a + b) * c / d = 24 And X16 = 0 Then Text1.Text = Text1.Text & "  " & "(" & a & "+" & b & ")" & "×" & c & "÷" & d & vbCrLf: X16 = 1
If (a + b / c) * d = 24 And X17 = 0 Then Text1.Text = Text1.Text & "  " & "(" & a & "+" & b & "÷" & c & ")" & "×" & d & vbCrLf: X17 = 1
If a * b + c - d = 24 And X18 = 0 Then Text1.Text = Text1.Text & "  " & a & "×" & b & "+" & c & "-" & d & vbCrLf: X18 = 1
If a * (b - c / d) = 24 And X19 = 0 Then Text1.Text = Text1.Text & "  " & a & "×" & "(" & b & "-" & c & "÷" & d & ")" & vbCrLf: X19 = 1
If a * b / (c + d) = 24 And X20 = 0 Then Text1.Text = Text1.Text & "  " & a & "×" & b & "÷" & "(" & c & "+" & d & ")" & vbCrLf: X20 = 1
If a / b + c * d = 24 And X21 = 0 Then Text1.Text = Text1.Text & "  " & a & "÷" & b & "+" & c & "×" & d & vbCrLf: X21 = 1
If a / b * c - d = 24 And X27 = 0 Then Text1.Text = Text1.Text & "  " & a & "÷" & b & "×" & c & "-" & d & vbCrLf: X27 = 1
If (a * b - c) / d = 24 And X22 = 0 Then Text1.Text = Text1.Text & "  " & "(" & a & "×" & b & "-" & c & ")" & "÷" & d & vbCrLf: X22 = 1
If (a / b - c) * d = 24 And X23 = 0 Then Text1.Text = Text1.Text & "  " & "(" & a & "÷" & b & "-" & c & ")" & "×" & d & vbCrLf: X23 = 1
If a * (b - c) / d = 24 And X24 = 0 Then Text1.Text = Text1.Text & "  " & a & "×" & "(" & b & "-" & c & ")" & "÷" & d & vbCrLf: X24 = 1
If a * (b / c - d) = 24 And X25 = 0 Then Text1.Text = Text1.Text & "  " & a & "×" & "(" & b & "÷" & c & "-" & d & ")" & vbCrLf: X25 = 1
 If c - d <> 0 Then
If a * b / (c - d) = 24 And X26 = 0 Then Text1.Text = Text1.Text & "  " & a & "×" & b & "÷" & "(" & c & "-" & d & ")" & vbCrLf: X26 = 1
 End If
10           Next h
         Next g
   Next f
Next
 If Text1.Text = "" Then
 GoTo 20
 End If
 
End Sub

Private Sub Command2_Click()
Text1.Visible = True
End Sub

Private Sub Form_Load()
Text1.Text = ""
Text1.Visible = False
For i = 0 To 39
 Picture1(i).Visible = False
Next i
End Sub

Private Sub Label1_Click()
MsgBox "本程序作者:傅城州"
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -