//

import java.io.*;
import java.util.StringTokenizer;

class Router
{
	public static void main( String args[] ) throws IOException
	{
		Board myBoard = new Board( 15, 20 );
		int i;
		FileInputStream pinInFile;
		//FileInputStream boardInFile;
		//FileOutputStream boardOutFile;
		try
		{
			pinInFile = new FileInputStream( args[0] );
			//boardInFile = new FileInputStream( args[1] );
			//boardOutFile = new FileOutputStream( args[2] );
		}
		catch( FileNotFoundException e )
		{
			System.out.println( "File Not Found" );
			return;
		}
		catch( IOException e )
		{
			System.out.println( "Error Opening Output File" );
			return;
		}
		catch( ArrayIndexOutOfBoundsException e )
		{
			System.out.println( "Usage: ParseFile From To" );
			return;
		}

		myBoard.Read();

		try
		{
			System.out.print("Read line of pinInFile\n");
			do
			{
				i = pinInFile.read();
				if( i != -1 ) System.out.print( (char) i );
			} while( i != -1 );
			myBoard.Route( 0, 0, 9, 9 );
		}
		catch( IOException e )
		{
			System.out.println( "File Error" );
		}

		myBoard.Write();

		pinInFile.close();
		//boardInFile.close();
		//boardIOutFile.close();
	}
}
