public static void play_game(Scanner input, char[] gameArray, boolean[] flipped) {

		int pair1, pair2, boxesFlipped = 0, attempts = 0;
		boolean gameFinished = false;
		
		while (!gameFinished) {

			//draws the visual output of the game for the user
			drawOutput(gameArray, flipped);
			
			System.out.print("Please enter which two boxes you would like to flip: ");
			pair1 = input.nextInt();
			pair2 = input.nextInt(); //gets the two locations that the user wants to flip
			
			if ((pair1 - 1) < 0 || (pair2 - 1) < 0 || (pair1 - 1) > gameArray.length || (pair2 - 1) > gameArray.length) {
			
				//simple check to see if the values entered are valid
				System.out.println("The values entered are outside the valid range.");
				
			} else if (flipped[pair1 - 1] == true || flipped[pair2 - 1] == true) {
				
				//simple check to see if the locations are already flipped
				System.out.println("Values entered are already used.");
				
			} else {
				
				//if valid values are entered, reveal the face values are the locations chosen
				if (check_pairing(pair1, pair2, gameArray)){ //call method check_pairing to see if the values match
					
					//if they match, flag those locations as flipped and increment the number of
					//cells flipped by 2
					flipped[pair1 - 1] = true;
					flipped[pair2 - 1] = true;
					boxesFlipped += 2; 
					
				}
				
				if (boxesFlipped == gameArray.length) {
					
					//if the number of boxes flipped is equal to the number of cells in gameArray
					//the game is finished and flag it as so to exit of the play_game method
					gameFinished = true;
					
				} else {
					
					//if the game is still in progress, show the user the face values of the two
					//locations that they chose
					showOutput(pair1, pair2, gameArray, flipped);
					
				}
				
				attempts++; //keep track of the number of attempts made
			}
		}
		
		//once finished, show the user the completed array and the play statistics
		drawOutput(gameArray, flipped);
		System.out.println("Game finished with " + attempts + " attempts.");
		System.out.println("That is " + (attempts - (gameArray.length)/2) + " more than the best possible result.");
		
	}