Finance

Charts

Statistics

Macros

Search

Prompting to Start a New Game in Excel VBA

After successfully completing the puzzle, the user is asked whether they want to start a new game. If the answer is Yes, the procedure PromptNewGame() is called to begin a new puzzle. Otherwise, the procedure ClearBoard() is called to clear the board:

Sub PromptNewGame()
    If MsgBox("Congratulations! Start a new game?", _
              vbYesNo, "New Game?") = vbYes Then
        StartGame
    Else
        ClearBoard
    End If
End Sub

Additional Tips:

Enjoy playing, exploring the code, and creating your own extensions! For example:

  • Provide multiple images and select one randomly for each new game.
  • Adjust the number of puzzle pieces (e.g., 3×3, 4×4, 6×6) to control the difficulty level.
  • Track time or number of moves to make it competitive.
  • Add sound effects or animations for a more dynamic experience.
0 0 votes
Évaluation de l'article
S’abonner
Notification pour
guest
0 Commentaires
Le plus ancien
Le plus récent Le plus populaire
Online comments
Show all comments
Facebook
Twitter
LinkedIn
WhatsApp
Email
Print
0
We’d love to hear your thoughts — please leave a commentx