程序包 Hangman

类 HangmanGame


  • public class HangmanGame
    extends java.lang.Object
    This is the HangmanGame "Controller" class that launches the game and takes user input, and by reading the user input of continuing the game or not, this class also allows users to run multiple rounds of word guessing in a single run. Besides, I wrote two versions in one class, because traditional version is obviously the special version of evil version that contains only one word in the game set. Therefore, only the game controller class will control the version that user is playing.
    作者:
    Kevin Long
    • 字段概要

      字段 
      修饰符和类型 字段 说明
      (专用程序包) int available  
      (专用程序包) boolean conti  
      (专用程序包) java.util.ArrayList<java.lang.String> original  
    • 构造器概要

      构造器 
      构造器 说明
      HangmanGame​(java.util.ArrayList<java.lang.String> s)  
    • 方法概要

      所有方法 静态方法 实例方法 具体方法 
      修饰符和类型 方法 说明
      static int availableLength​(java.util.ArrayList<java.lang.String> words)
      This static method loops through the available word list and return the maximum length of the world in the world list, so that the random method do not generate word length that is too long and there is not match in the list.
      java.util.ArrayList<java.lang.String> gameSet​(int length)
      This method loops through the available word list and return the ArrayList word list where all words are exactly the same length as given int length.
      static void main​(java.lang.String[] args)  
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 字段详细资料

      • original

        java.util.ArrayList<java.lang.String> original
      • available

        int available
      • conti

        boolean conti
    • 构造器详细资料

      • HangmanGame

        public HangmanGame​(java.util.ArrayList<java.lang.String> s)
    • 方法详细资料

      • availableLength

        public static int availableLength​(java.util.ArrayList<java.lang.String> words)
        This static method loops through the available word list and return the maximum length of the world in the world list, so that the random method do not generate word length that is too long and there is not match in the list.
        参数:
        words -
        返回:
      • gameSet

        public java.util.ArrayList<java.lang.String> gameSet​(int length)
        This method loops through the available word list and return the ArrayList word list where all words are exactly the same length as given int length.
        参数:
        length -
        返回:
      • main

        public static void main​(java.lang.String[] args)