import java.io.FileNotFoundException;
import java.util.Scanner;

public class MadLibsGame
{
	public static void main(String[] args) throws FileNotFoundException
	{
		String fileName = args[0];
		MadLibs madLibs = new MadLibs(fileName);
		Scanner inputScanner = new Scanner(System.in);
		
		do
		{
			madLibs.playGame(inputScanner);
			System.out.println();
			
			// see if the user still wants to play
			System.out.print("Want to play again? If so enter \"yes\" to play, \"quit\" to quit: ");
			String response = inputScanner.next();
			
			// any answer other than "yes" will terminate the loop
			if(!response.equalsIgnoreCase("yes"))
			{
				break;
			}
		}while(true);
	}
}