- Beranda
- Komunitas
- Tech
- Programmer Forum
tolong di bntu ea abg2 kakak2
TS
wakboo
tolong di bntu ea abg2 kakak2
ni yg slah apa ea soal na pening x ni -_-
'Private Declare Function playSound Lib "winmm.dll" () Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Private Const SND_ASYNC = &H1
Private Sub Form_Load()
Frame2.Top = Frame1.Top
Frame2.Left = Frame1.Left
End Sub
Private Sub Cell_Click(index As Integer)
pressed = Cell(index).Caption
' Move Number Down
If index <= 15 - 4 Then
If Cell(index + 4).Caption = "" Then
Cell(index).Caption = Cell(index + 4).Caption
Cell(index + 4).Caption = pressed
End If
End If
' Move Number Up
If index - 4 >= 0 Then
If Cell(index - 4).Caption = "" Then
Cell(index).Caption = Cell(index - 4).Caption
Cell(index - 4).Caption = pressed
End If
End If
' Move Number Left
If index - 1 >= 0 And (index Mod 4) > 0 Then
If Cell(index - 1).Caption = "" Then
Cell(index).Caption = Cell(index - 1).Caption
Cell(index - 1).Caption = pressed
End If
End If
' Move Number Right
If index + 1 <= 15 And index <> 3 And index <> 7 And index <> 11 And index <> 15 Then
If Cell(index + 1).Caption = "" Then
Cell(index).Caption = Cell(index + 1).Caption
Cell(index + 1).Caption = pressed
End If
End If
End Sub
Private Sub Frame2_Click()
Frame2.Visible = False 'Author's Frame
Frame1.Visible = True 'Numbers Frame
End Sub
Private Sub Label2_Click()
Dim xyz As Long
xyz = Shell("start mailto:" + " ElvianiMalau@ymail.com", 0)
End Sub
Private Sub lbl_Click(index As Integer)
Frame2.Visible = False
Frame1.Visible = True
End Sub
Private Sub mnuAuthor_Click()
Frame2.Visible = False 'Numbers Frame
Frame1.Visible = True 'Author's Frame
End Sub
'New Game
Private Sub NewGame_Click()
'Dim Cell(50) As Integer
num = 0
Frame1.Visible = True
Frame1.Enabled = True
Frame2.Visible = False
Cell(15).Caption = ""
For i = 0 To 14
num = Val(Right(Str(Rnd(15)), 2))
If i = 8 Then num = 10
If num > 15 Then
i = i - 1
Else
num = Val(Right(Str(Rnd(15)), 2))
Cell(15).SetFocus
For j = 0 To i - 1
If Val(Cell(j).Caption) = num Then
i = i - 1
End If
Next j
End If
Next i
20 '
num = Val(Right(Str(Rnd(15)), 2))
If num > 15 Then GoTo 20
Cell(8).Caption = Cell(num).Caption
Cell(num).Caption = 10
Cell(15).SetFocus
End Sub
'Private Declare Function playSound Lib "winmm.dll" () Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Private Const SND_ASYNC = &H1
Private Sub Form_Load()
Frame2.Top = Frame1.Top
Frame2.Left = Frame1.Left
End Sub
Private Sub Cell_Click(index As Integer)
pressed = Cell(index).Caption
' Move Number Down
If index <= 15 - 4 Then
If Cell(index + 4).Caption = "" Then
Cell(index).Caption = Cell(index + 4).Caption
Cell(index + 4).Caption = pressed
End If
End If
' Move Number Up
If index - 4 >= 0 Then
If Cell(index - 4).Caption = "" Then
Cell(index).Caption = Cell(index - 4).Caption
Cell(index - 4).Caption = pressed
End If
End If
' Move Number Left
If index - 1 >= 0 And (index Mod 4) > 0 Then
If Cell(index - 1).Caption = "" Then
Cell(index).Caption = Cell(index - 1).Caption
Cell(index - 1).Caption = pressed
End If
End If
' Move Number Right
If index + 1 <= 15 And index <> 3 And index <> 7 And index <> 11 And index <> 15 Then
If Cell(index + 1).Caption = "" Then
Cell(index).Caption = Cell(index + 1).Caption
Cell(index + 1).Caption = pressed
End If
End If
End Sub
Private Sub Frame2_Click()
Frame2.Visible = False 'Author's Frame
Frame1.Visible = True 'Numbers Frame
End Sub
Private Sub Label2_Click()
Dim xyz As Long
xyz = Shell("start mailto:" + " ElvianiMalau@ymail.com", 0)
End Sub
Private Sub lbl_Click(index As Integer)
Frame2.Visible = False
Frame1.Visible = True
End Sub
Private Sub mnuAuthor_Click()
Frame2.Visible = False 'Numbers Frame
Frame1.Visible = True 'Author's Frame
End Sub
'New Game
Private Sub NewGame_Click()
'Dim Cell(50) As Integer
num = 0
Frame1.Visible = True
Frame1.Enabled = True
Frame2.Visible = False
Cell(15).Caption = ""
For i = 0 To 14
num = Val(Right(Str(Rnd(15)), 2))
If i = 8 Then num = 10
If num > 15 Then
i = i - 1
Else
num = Val(Right(Str(Rnd(15)), 2))
Cell(15).SetFocus
For j = 0 To i - 1
If Val(Cell(j).Caption) = num Then
i = i - 1
End If
Next j
End If
Next i
20 '
num = Val(Right(Str(Rnd(15)), 2))
If num > 15 Then GoTo 20
Cell(8).Caption = Cell(num).Caption
Cell(num).Caption = 10
Cell(15).SetFocus
End Sub
0
1.4K
12
Thread Digembok
Urutan
Terbaru
Terlama
Thread Digembok
Komunitas Pilihan