Buggy code:
while ( ! done ) { System . out . println ( "MENU:" ) ; System . out . println ( "1.<seq2seq4repair_space>Watch<seq2seq4repair_space>AI<seq2seq4repair_space>play<seq2seq4repair_space>a<seq2seq4repair_space>game." ) ; System . out . println ( "2.<seq2seq4repair_space>View<seq2seq4repair_space>previous<seq2seq4repair_space>game<seq2seq4repair_space>score." ) ; System . out . println ( "3.<seq2seq4repair_space>View<seq2seq4repair_space>cumulative<seq2seq4repair_space>scores." ) ; System . out . println ( "4.<seq2seq4repair_space>View<seq2seq4repair_space>average<seq2seq4repair_space>score." ) ; System . out . println ( "5.<seq2seq4repair_space>Exit." ) ; numInput = keyboard . nextInt ( ) ; if ( numInput == 1 ) { System . out . println ( "How<seq2seq4repair_space>many<seq2seq4repair_space>games<seq2seq4repair_space>would<seq2seq4repair_space>you<seq2seq4repair_space>like<seq2seq4repair_space>the<seq2seq4repair_space>AI<seq2seq4repair_space>to<seq2seq4repair_space>play?" ) ; numInput = keyboard . nextInt ( ) ; for ( int numOfGames = 0 ; numOfGames < numInput ; numOfGames ++ ) { Scorecard scorecard = new Scorecard ( ) ; System . out . println ( ( ( "***************Game<seq2seq4repair_space>Number:<seq2seq4repair_space>" + ( numOfGames + 1 ) ) + "<seq2seq4repair_space>*****************" ) ) ; for ( int turn = 0 ; turn < 13 ; turn ++ ) { for ( int jnc = 0 ; jnc < ( numOfValues . length ) ; jnc ++ ) { numOfValues [ jnc ] = 0 ; } System . out . println ( ( "This<seq2seq4repair_space>is<seq2seq4repair_space>turn<seq2seq4repair_space>number:<seq2seq4repair_space>" + ( turn + 1 ) ) ) ; for ( int i = 0 ; i < 5 ; i ++ ) { dice [ i ] = new Dice ( ) ; dice [ i ] . roll ( ) ; } System . out . println ( ( ( ( ( ( ( ( ( ( "Dice<seq2seq4repair_space>Values<seq2seq4repair_space>after<seq2seq4repair_space>roll<seq2seq4repair_space>1<seq2seq4repair_space>:<seq2seq4repair_space>" + ( dice [ 0 ] . getValue ( ) ) ) + "<seq2seq4repair_space>" ) + ( dice [ 1 ] . getValue ( ) ) ) + "<seq2seq4repair_space>" ) + ( dice [ 2 ] . getValue ( ) ) ) + "<seq2seq4repair_space>" ) + ( dice [ 3 ] . getValue ( ) ) ) + "<seq2seq4repair_space>" ) + ( dice [ 4 ] . getValue ( ) ) ) ) ; strategy = new RandomStrategy ( ) ; message = "Random<seq2seq4repair_space>Strategy<seq2seq4repair_space>being<seq2seq4repair_space>used." ; for ( int inc = 0 ; inc < ( dice . length ) ; inc ++ ) { diceValues [ inc ] = dice [ inc ] . getValue ( ) ; if ( ( diceValues [ inc ] ) == 1 ) ( numOfValues [ 0 ] ) ++ ; else if ( ( diceValues [ inc ] ) == 2 ) ( numOfValues [ 1 ] ) ++ ; else if ( ( diceValues [ inc ] ) == 3 ) ( numOfValues [ 2 ] ) ++ ; else if ( ( diceValues [ inc ] ) == 4 ) ( numOfValues [ 3 ] ) ++ ; else if ( ( diceValues [ inc ] ) == 5 ) ( numOfValues [ 4 ] ) ++ ; else if ( ( diceValues [ inc ] ) == 6 ) ( numOfValues [ 5 ] ) ++ ; } if ( ( ( ( numOfValues [ 2 ] ) >= 1 ) && ( ( numOfValues [ 3 ] ) >= 1 ) ) && ( ! ( scorecard . straightTaken ( ) ) ) ) { for ( int i = 0 ; i < ( numOfValues . length ) ; i ++ ) { if ( ( numOfValues [ i ] ) == 1 ) { straightChecker ++ ; } } if ( straightChecker >= 3 ) { strategy = new StraightStrategy ( ) ; message = "Straight<seq2seq4repair_space>Strategy<seq2seq4repair_space>being<seq2seq4repair_space>used." ; } } else { for ( int i = 0 ; i < ( numOfValues . length ) ; i ++ ) { if ( ( ( numOfValues [ i ] ) >= 3 ) && ( ! ( scorecard . ofAKinderTaken ( ) ) ) ) { strategy = new OfAKinderStrategy ( ) ; message = "Of<seq2seq4repair_space>A<seq2seq4repair_space>Kinder<seq2seq4repair_space>Strategy<seq2seq4repair_space>being<seq2seq4repair_space>used." ; } } } if ( strategy instanceof RandomStrategy ) for ( int i = 0 ; i < ( numOfValues . length ) ; i ++ ) { if ( ( ( numOfValues [ i ] ) >= 2 ) && ( ! ( scorecard . upperSectionTaken ( ) ) ) ) { strategy = new UpperSectionerStrategy ( ) ; message = "Upper<seq2seq4repair_space>Sectioner<seq2seq4repair_space>Strategy<seq2seq4repair_space>being<seq2seq4repair_space>used." ; } } if ( strategy instanceof RandomStrategy ) if ( ! ( scorecard . getTaken ( 12 ) ) ) { strategy = new FourAndUpStrategy ( ) ; message = "Four<seq2seq4repair_space>And<seq2seq4repair_space>Up<seq2seq4repair_space>Strategy<seq2seq4repair_space>being<seq2seq4repair_space>used." ; } System . out . println ( message ) ; scorecard = strategy . operation ( dice , scorecard ) ; System . out . println ( ( "End<seq2seq4repair_space>of<seq2seq4repair_space>turn:<seq2seq4repair_space>" + ( turn + 1 ) ) ) ; System . out . println ( ( "Total<seq2seq4repair_space>score:<seq2seq4repair_space>" + ( scorecard . getTotalScore ( ) ) ) ) ; } totalGames ++ ; savedScores . addScorecard ( scorecard ) ; } } else if ( numInput == 2 ) { System . out . println ( "Which<seq2seq4repair_space>game<seq2seq4repair_space>score<seq2seq4repair_space>did<seq2seq4repair_space>you<seq2seq4repair_space>want<seq2seq4repair_space>to<seq2seq4repair_space>view?" ) ; numInput = keyboard . nextInt ( ) ; <START_BUG> if ( ( numInput > totalGames ) || ( numInput <= 1 ) ) <END_BUG> System . out . println ( "Invalid<seq2seq4repair_space>game." ) ; else System . out . println ( ( ( ( "Game<seq2seq4repair_space>number<seq2seq4repair_space>" + numInput ) + "<seq2seq4repair_space>score:<seq2seq4repair_space>" ) + ( getGameScore ( ( numInput - 1 ) ) ) ) ) ; } else if ( numInput == 3 ) { System . out . println ( ( ( ( "Cumulative<seq2seq4repair_space>score<seq2seq4repair_space>of<seq2seq4repair_space>" + totalGames ) + "<seq2seq4repair_space>games<seq2seq4repair_space>=<seq2seq4repair_space>" ) + ( getCumulativeScore ( ) ) ) ) ; } else if ( numInput == 4 ) { System . out . println ( ( ( ( "Average<seq2seq4repair_space>score<seq2seq4repair_space>of<seq2seq4repair_space>" + totalGames ) + "<seq2seq4repair_space>games<seq2seq4repair_space>=<seq2seq4repair_space>" ) + ( ( getCumulativeScore ( ) ) // totalGames ) ) ) ; } else if ( numInput == 5 ) { done = true ; } else System . out . println ( "Invalid<seq2seq4repair_space>menu<seq2seq4repair_space>selection.<seq2seq4repair_space>Please<seq2seq4repair_space>select<seq2seq4repair_space>a<seq2seq4repair_space>different<seq2seq4repair_space>option.<seq2seq4repair_space>" ) ; } } public double getCumulativeScore ( ) { } public double getGameScore ( int index ) { } }

Fix:
if ( ( numInput > totalGames ) || ( numInput < 1 ) )