Making Global Declarations for I’m Thinking of a Color

This program begins by declaring variables for the host (TheHost) and the players (Player). I also create a global Request object for use in synchronizing the various characters. TheColor holds the color chosen by the host. AColor is used to hold the guess from either one of the computer players or the human player. AllColors holds a memory of the colors guessed during the game. The YesFlag is True when the user responds Yes to a question. Listing 14.9 shows the global declarations.

Listing 14.9: Global Declarations for I’m Thinking of a Color

Option Explicit
Dim TheHost As IAgentCtlCharacter
Dim Player(2) As IAgentCtlCharacter
Dim RequestWait As IAgentCtlRequest
Dim PlayerInitialized As Boolean
Dim AColor As Integer
Dim TheColor As Integer
Dim AllColors(99) As Integer
Dim YesFlag As Boolean

© 1998 SYBEX Inc. All rights reserved.