Guest User

Untitled

a guest
Apr 20th, 2018
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.42 KB | None | 0 0
  1. import java.util.*;
  2. public class Dictionary {
  3. private Random rndm = new Random();
  4. private String word[] = {"PHONES", "HOUSES", "ACCORD", "WINDOW", "MEXICO",
  5. "NEVADA", "RESULT", "ETCHES", "PUBLIC", "GREENS", "BETRAY",
  6. "FAMILY", "BATMAN", "CASUAL", "DRIVER", "HARDLY", "CHEESE",
  7. "IMMUNE", "BUTTON", "MEDIUM", "NOTICE", "ORPHAN", "ENCORE",
  8. "SCHOOL", "UNIONS" };
  9.  
  10. private String hard[] = {"LAZILY", "RHYTHM", "COAXES", "QUARTZ", "FIZZED",
  11.         "EJECTS", "MATRIX", "PHOOEY", "JOUSTS", "SENSEI", "ZYGOTE",
  12.         "YONKER", "WOWSER", "JUGFUL", "KAYAKS", "VERTEX", "UTOPIA",
  13.         "SCHEME", "QWERTY", "KLUTZY", "IGUANA", "EPONYM", "GLYCOL",
  14.         "QUICHE", "ZEPHYR"};
  15.  
  16. private int hardIndex = rndm.nextInt(24);
  17. private int wordIndex = rndm.nextInt(24);
  18.  
  19. public Dictionary (){
  20. }
  21. public Dictionary(int num, int num2){
  22. word[wordIndex] = word[num];
  23. hard[hardIndex] = hard[num2];
  24. }
  25. public String getWord(){
  26. return word[wordIndex];
  27. }
  28. public void setWord(int x){
  29. x = rndm.nextInt(24);
  30. word[wordIndex] = word[x];
  31. }
  32. public void setRandomWord(int x){
  33. x = rndm.nextInt(24);
  34. word[wordIndex] = word[x];
  35. }
  36.  
  37. public String getHard(){
  38. return hard[hardIndex];
  39. }
  40. public void setHard(int y){
  41. y = rndm.nextInt(24);
  42. word[wordIndex] = hard[y];
  43. }
  44. public void setRandomHard(int y){
  45. y = rndm.nextInt(24);
  46. word[wordIndex] = hard[y];
  47. }
  48. public String toStringHard(){
  49. return hard[hardIndex];
  50. }
  51.  
  52. public String toString(){
  53. return word[wordIndex];
  54. }
  55.  
  56. }
Add Comment
Please, Sign In to add comment