document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1.  
  2. /**
  3.  * Merupakan main class dari aplikasi "World of Zuul".
  4.  * berisi daftar dari semua command word yang diketahui game.
  5.  *
  6.  * @author Daffa Amanullah Setyawan
  7.  * @version 1.0
  8.  */
  9. public class CommandWords
  10. {
  11.   // sebuah array konstan yang berisi command word valid
  12.   private static final String validCommands[] = {
  13.       "go","quit","help","look"
  14.   };
  15.  
  16.   /**
  17.    * Constructor - inisialisasi command word.
  18.    */
  19.   public CommandWords(){
  20.       //nothing to do at the moment...
  21.   }
  22.  
  23.   /**
  24.    * Mengecek apakah string adalah command word valid
  25.    * Return true jika iya, false jika bukan.
  26.    */
  27.   public boolean isCommand(String aString){
  28.       for(int i = 0; i < validCommands.length; i++)
  29.       {
  30.           if(validCommands[i].equals(aString))
  31.                 return true;
  32.       }
  33.       return false;
  34.     }
  35. }
');