26.3. Number Guess Example: Classes and Methods

Note

The Number Guess Example classes are all contained within the NumberGuessExample.java file.
  • Class GameRules provides the maximum range and the number of guesses allowed.
  • Class RandomNumber automatically generates a number between 0 and 100 and makes it available to the rules. It does so by insertion via the getValue() method.
  • Class Game keeps track of the number of guesses made.
  • To start the process, the startProcess() method is called.
  • To execute the rules, the fireAllRules() method is called.
  • To clear the Working Memory session, the dispose() method is called.