import java.util.Random ;

public class GrumpsGenerator {

private final String INTRO_START = "Welcome back to" ;

private final String OUTRO_START = "Next time on" ;

private final String [ ] NAMES = { "Game Grumps" , "Gample Gust" , "Grep" ,

"Gash Garst" , "Gurp Gurp Gurp Gurp" , "Squidward" , "Batman" ,

"Grumble Dumps" , "Groomp Croomp" , "Gargarsh" , "Grusput" , "Goof Troop" } ;

private final int UPPERCASE_NAMES = 0 ;

private final String [ ] LINE_STARTS = { "OH IT'S A" ,

"ROLLING AROUND AT THE SPEED OF" , "POPPY BROTHERS JUNIOR" ,

"WHAT IS THIS?" , "Look at this" , "Look at that dang-ass" , "Real talk?" ,

"I legitimately think" , "I hate when" , "Pause balls by going upstairs," } ;

private final int UPPERCASE_LINE_STARTS = 4 ;

private final String [ ] LINE_ENDS = { "IT'S NO USE" , "BARRY, PUT THAT IN" ,

"POPPY BROTHERS SENIOR" , "WE ALWAYS RESET TOGETHER" , "GREATGREATGREAT" ,

"WHAT IS MY LIFE?" , "Pumbloom" , "dang" , "game feel" , "Silver" ,

"*Jon coughs*" , "[JON NO]" , "Chiz Peetza" } ;

private final int UPPERCASE_LINE_ENDS = 6 ;

private Random random ;

private StringBuilder sb ;

private int lineCount ;

public GrumpsGenerator ( ) {

random = new Random ( ) ;

sb = new StringBuilder ( ) ;

generateIntro ( ) ;

lineCount = random. nextInt ( 30 ) + 5 ;

generateLines ( lineCount ) ;

generateOutro ( ) ;

}

public void generateIntro ( ) {

String intro = INTRO_START + " " + NAMES [ random. nextInt ( NAMES. length ) ] ;

sb. append ( intro + "

" ) ;

}

public void generateLines ( int n ) {

for ( int i = 0 ; i < n ; i ++ ) {

int lineStartIndex = random. nextInt ( LINE_STARTS. length ) ;

int lineEndIndex = random. nextInt ( LINE_ENDS. length ) ;

String line = LINE_STARTS [ lineStartIndex ] + " " + LINE_ENDS [ lineEndIndex ] ;

if ( lineStartIndex < UPPERCASE_LINE_STARTS

|| lineEndIndex < UPPERCASE_LINE_ENDS )

line = line. toUpperCase ( ) ;

sb. append ( line + "

" ) ;

}

}

public void generateOutro ( ) {

String outro = OUTRO_START + " " + NAMES [ random. nextInt ( NAMES. length ) ] ;

sb. append ( outro + "

" ) ;

}

@Override

public String toString ( ) {

return sb. toString ( ) ;

}

public static void main ( String [ ] args ) {

System . out . println ( new GrumpsGenerator ( ) ) ;

}