Guest User

Untitled

a guest
Aug 18th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. public static void main (String [] args){
  2. Scanner input = new Scanner(System.in); //Initialize variables
  3. Boggle bog = new Boggle();
  4. DiceTray board = new DiceTray();
  5. bog.setDiceTray(board);
  6. String end = "zz";
  7. int base = 0;
  8.  
  9. //Print the Board
  10. System.out.print("Play One Game of Boggle :" + '\n');
  11. System.out.println(bog.getDiceTrayAsString());
  12. System.out.print("Enter words or zz to quit :");
  13. String tried = input.next();
  14. //Ends game when user enters zz
  15. while(!tried.equalsIgnoreCase(end)){
  16. bog.addGuess(tried);
  17. tried = input.next();
  18. }
  19. //Show the User Score, Words they entered, Number of words User could have found
  20. //and Show the Words they missed
  21. System.out.print('\n');
  22. System.out.print("Your Score : " + bog.getScore());
  23. System.out.print('\n' + "Words You Found :" + bog.getWordsFound());
  24. System.out.print('\n' + "Incorrect words : " + bog.getWordsIncorrect());
  25. System.out.print('\n' + "You could have found " + bog.getWordsNotGuessed().size() + " more words");
  26. System.out.print('\n' + "Your Computer found all your words plus these : " + '\n');
  27. //When 10 words are printed start another line for the next 10
  28. for(int x = 0; x < bog.getWordsNotGuessed().size(); x++){
  29. if(base%10 !=0 ){
  30. System.out.print(bog.getWordsNotGuessed().get(x) + " ");
  31. base++;
  32. }
  33. else{
  34. System.out.print('\n' + bog.getWordsNotGuessed().get(x) + " ");
  35. base = 1;
  36. }
  37. }
Add Comment
Please, Sign In to add comment