tailieunhanh - Microsoft WSH and VBScript Programming for the Absolute Beginner Part 41
Microsoft WSH and VBScript Programming for the Absolute Beginner by Jerry Lee Ford Part 41. 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,. | 380 Microsoft WSH and VBScript Programming for the Absolute Beginner Second Edition Function MarkPlayerSelection Mark an X or O in the appropriate cell If strPlayerInput Al Then Al strPlayer End If If strPlayerInput A2 Then A2 strPlayer End If If strPlayerInput A3 Then A3 strPlayer End If If strPlayerInput Bl Then Bl strPlayer End If If strPlayerInput B2 Then B2 strPlayer End If If strPlayerInput B3 Then B3 strPlayer End If If strPlayerInput Cl Then Cl strPlayer End If If strPlayerInput C2 Then C2 strPlayer End If If strPlayerInput C3 Then C3 strPlayer End If End Function Building the SeeIfWon Function The SeeIfWon function shown here performs a series of eight tests to see whether the game has been won by one of the players. These tests include checking all three cells in each row and in each column to see whether the same player has selected them. The function also checks diagonally to see whether there is a winner. Chapter 11 Working with Built-In VBScript Objects Function SeeIfWon Check across the first row If A1 strPlayer Then If A2 strPlayer Then If A3 strPlayer Then strWinner strPlayer strDirection - First row across End If End If End If Check across the second row If B1 strPlayer Then If B2 strPlayer Then If B3 strPlayer Then strWinner strPlayer strDirection - Second row across End If End If End If Check across the third row If C1 strPlayer Then If C2 strPlayer Then If C3 strPlayer Then strWinner strPlayer strDirection - Third row across End If End If End If Check the first column If A1 strPlayer Then If B1 strPlayer Then If C1 strPlayer Then strWinner strPlayer strDirection - First column down Microsoft WSH and VBScript Programming for the Absolute Beginner Second Edition End If End If End If Check the second column If A2 strPlayer Then If B2 strPlayer Then If C2 strPlayer Then strWinner strPlayer strDirection - Second column down End If End If End If Check the third column If A3 strPlayer Then If B3 strPlayer Then If C3 strPlayer Then strWinner strPlayer
đang nạp các trang xem trước