tailieunhanh - Microsoft WSH and VBScript Programming for the Absolute Beginner Part 37

Microsoft WSH and VBScript Programming for the Absolute Beginner by Jerry Lee Ford Part 37. If you are new to programming with Microsoft WSH and VBScript and are looking for a solid introduction, this is the book for you. Developed by computer science professors, books in the for the absolute beginner series teach the principles of programming through simple game creation. You will acquire the skills that you need for more practical WSH and VBScript programming applications and will learn how these skills can be put to use in real-world scenarios. Best of all, by the time you finish this book,. | Microsoft WSH and VBScript Programming for the Absolute Beginner Second Edition End If SplashScreen Procedure Section Function DoYouWantToPlay Display the splash screen and ask the user if he or she wants to play strSplashimage Space 100 vbCrLf _ W E L C O M E T O Space 68 Space 18 _ vbCrLf Space 100 0 Space 18 vbCrLf _ V B S c r i p t H A N G M A N Space 50 - - _ Space 15 vbCrLf Space 99 Spaced _ Space 17 vbCrLf Space 120 vbCrLf _ Space 120 vbCrLf space 113 vbCrLf Would you like to play a game vbCrLf DoYouWantToPlay MsgBox strSplashimage 36 cTitlebarMsg End Function Function PlayTheGame Initialize variables displayed in the game s initial pop-up dialog intNoMisses 0 intNoRight 0 strWrongGuesses strRightGuesses Get the game a mystery word strGameWord RetrieveWord Chapter 10 Using the Windows Registry to Configure Script Settings Call the function that formats the initial pop-up dialog display string strDisplayString InitialDisplayString strTempStringOne strGameWord Let the player start guessing Do Until intNoMisses 6 Collect the player s guess strChoice InputBox vbCrLf vbTab strDisplayString vbCrLf _ vbCrLf vbCrLf No. of Misses intNoMisses vbTab Incorrect strWrongGuesses vbCrLf vbCrLf vbCrLf Type a letter and click on OK. cTitleBarMsg Determine if the player has quit If strChoice Then Exit Function End If strProcessGuess FirstLevelValidation The Player wants to quit the game If strProcessGuess ExitFunction Then Exit Function End If The player typed invalid input If strProcessGuess SkipRest Then strProcessGuess SecondLevelValidation Select Case strProcessGuess Case DuplicateWrongAnswer MsgBox Invalid You ve already guessed this incorrect letter. Case DuplicateRightAnswer MsgBox Invalid You ve already guessed this correct letter. Case Else Microsoft WSH and VBScript Programming for the Absolute Beginner Second Edition strCheckAnswer TestLetterGuess If strCheckAnswer IncorrectAnswer Then Reset the value of the variable used to build a string containing .