-..-.-..-.-.-.-.-.-.-.-.-.-.-.-.-.-.-..-.-.-.-.-.-.-.-..-.-.-.-..-.-.-.-..-.-.-.-.-.-.-
Короче нужны советы по поводу этого проекта!
- Код: Выделить всё
Option Explicit
Public x
Private Sub Form_Initialize()
x = 0
End Sub
Private Sub L1_Click()
L1.Caption = "X"
x = x + 1
AI
L1.Enabled = False
L1.ForeColor = RGB(255, 0, 0)
End Sub
Private Sub L2_Click()
L2.Caption = "X"
x = x + 1
AI
L2.Enabled = False
End Sub
Private Sub L3_Click()
L3.Caption = "X"
x = x + 1
AI
L3.Enabled = False
End Sub
Private Sub L4_Click()
L4.Caption = "X"
x = x + 1
AI
L4.Enabled = False
End Sub
Private Sub L5_Click()
L5.Caption = "X"
x = x + 1
AI
End Sub
Private Sub L6_Click()
L6.Caption = "X"
x = x + 1
AI
L6.Enabled = False[/code]
End Sub
Private Sub L7_Click()
L7.Caption = "X"
x = x + 1
AI
L7.Enabled = False
End Sub
Private Sub L8_Click()
L8.Caption = "X"
x = x + 1
AI
L8.Enabled = False
End Sub
Private Sub L9_Click()
L9.Caption = "X"
x = x + 1
AI
L9.Enabled = False
End Sub
И модуль:
- Код: Выделить всё
[code] Option Explicit
Public Function AI()
If Knoliki.x = 1 Then
If Knoliki.L5.Caption = "" Then
Knoliki.L5 = "0"
Knoliki.L5.Enabled = False
End If
ElseIf Knoliki.x = 2 Then
If Knoliki.L1 <> "" And Knoliki.L9 = "" Then
Knoliki.L9 = "0"
ElseIf Knoliki.L1 <> "" And Knoliki.L8 = "" Then
Knoliki.L8 = "0"
ElseIf Knoliki.L1 <> "" And Knoliki.L7 = "" Then
Knoliki.L7 = "0"
ElseIf Knoliki.L1 <> "" And Knoliki.L6 = "" Then
Knoliki.L6 = "0"
ElseIf Knoliki.L1 <> "" And Knoliki.L5 = "" Then
Knoliki.L5 = "0"
ElseIf Knoliki.L1 <> "" And Knoliki.L4 = "" Then
Knoliki.L4 = "0"
ElseIf Knoliki.L1 <> "" And Knoliki.L3 = "" Then
Knoliki.L3 = "0"
ElseIf Knoliki.L1 <> "" And Knoliki.L2 = "" Then
Knoliki.L2 = "0"
ElseIf Knoliki.L1 <> "" And Knoliki.L1 = "" Then
Knoliki.L1 = "0"
End If
End If
End Function