; i & vbTab & _
GetSetting(TEXT_ANDERS_GAMES, TEXT_PUZZLE, i, "-") & vbTab & _
GetSetting(TEXT_ANDERS_GAMES, TEXT_PUZZLE, TEXT_PLAYER & i, "-") & vbNewLine
Next
'Show high score in msgbox
MsgBox strHighScore, vbOKOnly, TEXT_HIGH_SCORE
End Sub
Private Sub mnuSound_Click()
mnuSound.Checked = Not mnuSound.Checked
End Sub
Private Sub Timer1_Timer()
mlTime = mlTime + 1
Me.Caption = TEXT_TIME & " " & mlTime & " s"
End Sub
Private Static Sub NewGame()
Dim i%, j%, iSide%
Me.Caption = TEXT_PUZZLE
mlTime = 0
Timer1.Enabled = False
mbPuzzleSolved = True
iSide = Int((90 / miSize)) * 2 + 10
'Hide butons and set caption
For i = 0 To MAX_SIZE ^ 2 - 1
cmdButton(i).Visible = False
cmdButton(i).Caption = i + 1
Next i
'Place buttons
For i = 0 To miSize - 1
For j = 0 To miSize - 1
cmdButton(i * miSize + j).Height = iSide
cmdButton(i * miSize + j).Width = iSide
cmdButton(i * miSize + j).Left = iSide / 2 + iSide * j
cmdButton(i * miSize + j).Top = iSide / 2 + iSide * i
cmdButton(i * miSize + j).Visible = True
Next j
Next i
miEmptyIndex = miSize ^ 2 - 1
cmdButton(miEmptyIndex).Visible = False
cmdShuffle.Caption = TEXT_SHUFFLE
End Sub
Private Static Sub Shuffle()
Dim bMove As Boolean
Dim i%, xCoord%, yCoord%, iRand%
'Hide buttons before shuffle
For i = 0 To miSize ^ 2 - 1
cmdButton(i).Visible = False
Next i
'Coordinates for empty button
xCoord = (miEmptyIndex) Mod miSize
yCoord = (miEmptyIndex) \ miSize
'Move buttons in random directions
i = 0
While i < miSize ^ 4
bMove = False
iRand = Int(4 * Rnd)
If (iRand = 0) And (xCoord > 0) Then
xCoord = xCoord - 1
bMove = True
ElseIf (iRand = 1) And (xCoord < miSize - 1) Then
xCoord = xCoord + 1
bMove = True
ElseIf (iRand = 2) And (yCoord > 0) Then