Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main (String [] args){
- Scanner input = new Scanner(System.in); //Initialize variables
- Boggle bog = new Boggle();
- DiceTray board = new DiceTray();
- bog.setDiceTray(board);
- String end = "zz";
- int base = 0;
- //Print the Board
- System.out.print("Play One Game of Boggle :" + '\n');
- System.out.println(bog.getDiceTrayAsString());
- System.out.print("Enter words or zz to quit :");
- String tried = input.next();
- //Ends game when user enters zz
- while(!tried.equalsIgnoreCase(end)){
- bog.addGuess(tried);
- tried = input.next();
- }
- //Show the User Score, Words they entered, Number of words User could have found
- //and Show the Words they missed
- System.out.print('\n');
- System.out.print("Your Score : " + bog.getScore());
- System.out.print('\n' + "Words You Found :" + bog.getWordsFound());
- System.out.print('\n' + "Incorrect words : " + bog.getWordsIncorrect());
- System.out.print('\n' + "You could have found " + bog.getWordsNotGuessed().size() + " more words");
- System.out.print('\n' + "Your Computer found all your words plus these : " + '\n');
- //When 10 words are printed start another line for the next 10
- for(int x = 0; x < bog.getWordsNotGuessed().size(); x++){
- if(base%10 !=0 ){
- System.out.print(bog.getWordsNotGuessed().get(x) + " ");
- base++;
- }
- else{
- System.out.print('\n' + bog.getWordsNotGuessed().get(x) + " ");
- base = 1;
- }
- }
Add Comment
Please, Sign In to add comment