Buatlah Form game Puzzle di bawah ini
Berikut ini adalah Listing programgame Puzzle :
Private Sub
Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
MyBase.Load
Dim control
As Windows.Forms.Control
For Each
control In Me.Controls
If control.GetType.Name = "Button" Then
Dim rndnumber As Random
Dim number As Integer
rndnumber = New Random
number = rndnumber.Next(1, 9)
control.Text = number
If Button2.Text = Button1.Text Then
Do
number = rndnumber.Next(1, 9)
Button2.Text = number
Loop Until Button2.Text <>
Button1.Text
End If
If Button3.Text = Button2.Text Or Button3.Text =
Button1.Text Then
Do
number = rndnumber.Next(1, 9)
Button3.Text = number
Loop Until Button3.Text <>
Button2.Text And Button3.Text <> Button1.Text
End If
If Button4.Text = Button3.Text Or Button4.Text =
Button2.Text Or Button4.Text = Button1.Text Then
Do
number = rndnumber.Next(1, 9)
Button4.Text = number