程序包 Hangman
类 HangmanGame
- java.lang.Object
-
- 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
-
-
构造器概要
构造器 构造器 说明 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 ArrayListword list where all words are exactly the same length as given int length. static void
main(java.lang.String[] args)
-
-
-
方法详细资料
-
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 ArrayListword list where all words are exactly the same length as given int length. - 参数:
length
-- 返回:
-
main
public static void main(java.lang.String[] args)
-
-