Підтримка навчального процесу вивчення інформатики у Запорізькій гімназії №31 учителя Камєнєвої Ірини Дмитрівни (2013-2014 н.р.)

Скільки біт у кілобайті?

Код до гри "Хрестики-нолики"

Private Sub Command1_Click()
If Command1.Caption = "Грати" Then
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Randomize
f = Int(Rnd * 9) + 1
If f = 1 Then
Text1.Text = "X"
End If
If f = 2 Then
Text2.Text = "X"
End If
If f = 3 Then
Text3.Text = "X"
End If
If f = 4 Then
Text4.Text = "X"
End If
If f = 5 Then
Text5.Text = "X"
End If
If f = 6 Then
Text6.Text = "X"
End If
If f = 7 Then
Text7.Text = "X"
End If
If f = 8 Then
Text8.Text = "X"
End If
If f = 9 Then
Text9.Text = "X"
End If
Command1.Caption = "Завершити гру"
Label1.Visible = False
Label2.Visible = False
Label3.Visible = False
Else
If (Text1.Text = "X") And (Text2.Text = "X") And (Text3.Text = "X") Or (Text4.Text = "X") And (Text5.Text = "X") And (Text6.Text = "X") Or (Text7.Text = "X") And (Text8.Text = "X") And (Text9.Text = "X") Or (Text1.Text = "X") And (Text4.Text = "X") And (Text7.Text = "X") Or (Text2.Text = "X") And (Text5.Text = "X") And (Text8.Text = "X") Or (Text3.Text = "X") And (Text6.Text = "X") And (Text9.Text = "X") Or (Text3.Text = "X") And (Text5.Text = "X") And (Text7.Text = "X") Or (Text1.Text = "X") And (Text5.Text = "X") And (Text9.Text = "X") Then
Label1.Visible = True
End If
If (Text1.Text = "0") And (Text2.Text = "0") And (Text3.Text = "0") Or (Text4.Text = "0") And (Text5.Text = "0") And (Text6.Text = "0") Or (Text7.Text = "0") And (Text8.Text = "0") And (Text9.Text = "0") Or (Text1.Text = "0") And (Text4.Text = "0") And (Text7.Text = "0") Or (Text2.Text = "0") And (Text5.Text = "0") And (Text8.Text = "0") Or (Text3.Text = "0") And (Text6.Text = "0") And (Text9.Text = "0") Or (Text3.Text = "0") And (Text5.Text = "0") And (Text7.Text = "0") Or (Text1.Text = "0") And (Text5.Text = "0") And (Text9.Text = "0") Then
Label2.Visible = True
End If
If Label2.Visible = True And Label1.Visible = True Then
Label3.Visible = True
Label2.Visible = False
Label1.Visible = False
End If

Command1.Caption = "Грати"
Text1.Text = "L"
Text2.Text = "L"
Text3.Text = "L"
Text4.Text = "L"
Text5.Text = "L"
Text6.Text = "L"
Text7.Text = "L"
Text8.Text = "L"
Text9.Text = "L"

End If


End Sub




Private Sub Form_Load()
Command1.Caption = "Грати"
End Sub
Private Sub Text1_Click()
Text1.Text = "0"
Edit_X
End Sub
Private Sub Text2_Click()
Text2.Text = "0"
Edit_X
End Sub
Private Sub Text3_Click()
Text3.Text = "0"
Edit_X
End Sub
Private Sub Text4_Click()
Text4.Text = "0"
Edit_X
End Sub
Private Sub Text5_Click()
Text5.Text = "0"
Edit_X
End Sub
Private Sub Text6_Click()
Text6.Text = "0"
Edit_X
End Sub
Private Sub Text7_Click()
Text7.Text = "0"
Edit_X
End Sub
Private Sub Text8_Click()
Text8.Text = "0"
Edit_X
End Sub
Private Sub Text9_Click()
Text9.Text = "0"
Edit_X
End Sub
Private Sub Edit_X()
Dim f As Integer

Command1.Caption = "Думаю... можу зависнути :)"

PauseTime = Int(Rnd * 2)
Start = Timer
Do While Timer < Start + PauseTime
DoEvents
Loop

f = 0
While f = 0
Randomize
f = Int(Rnd * 9) + 1

If f = 9 And (Text9.Text = "0" Or Text9.Text = "X") Then
f = 0
End If
If f = 8 And (Text8.Text = "0" Or Text8.Text = "X") Then
f = 0
End If
If f = 7 And (Text7.Text = "0" Or Text7.Text = "X") Then
f = 0
End If
If f = 6 And (Text6.Text = "0" Or Text6.Text = "X") Then
f = 0
End If
If f = 5 And (Text5.Text = "0" Or Text5.Text = "X") Then
f = 0
End If
If f = 4 And (Text4.Text = "0" Or Text4.Text = "X") Then
f = 0
End If
If f = 3 And (Text3.Text = "0" Or Text3.Text = "X") Then
f = 0
End If
If f = 2 And (Text2.Text = "0" Or Text2.Text = "X") Then
f = 0
End If
If f = 1 And (Text1.Text = "0" Or Text1.Text = "X") Then
f = 0
End If
Wend

If f = 1 Then
Text1.Text = "X"
End If
If f = 2 Then
Text2.Text = "X"
End If
If f = 3 Then
Text3.Text = "X"
End If
If f = 4 Then
Text4.Text = "X"
End If
If f = 5 Then
Text5.Text = "X"
End If
If f = 6 Then
Text6.Text = "X"
End If
If f = 7 Then
Text7.Text = "X"
End If
If f = 8 Then
Text8.Text = "X"
End If
If f = 9 Then
Text9.Text = "X"
End If
Command1.Caption = "Завершити гру"
End Sub


Пошук по блогу