public static void main(String a[])	
	throws SocketException, IOException
    {
	String	hostName = new String("");
	int			port = 6000;
	String	team = new String("Krislet3");
	String prototype = "Krislet";
	
	try
	    {
		// First look for parameters
		for( int c = 0 ; c < a.length ; c += 2 )
		    {
			if( a[c].compareTo("-host") == 0 )
			    {
				hostName = a[c+1];
			    }
			else if( a[c].compareTo("-port") == 0 )
			    {
				port = Integer.parseInt(a[c+1]);
			    }
			else if( a[c].compareTo("-team") == 0 )
			    {
				team = a[c+1];
			    }
			else if ( a[c].compareTo("-proto") == 0 )
				{
				prototype = a[c+1];
				}
			else
			    {
				throw new Exception();
			    }
		    }
	    }
	catch(Exception e)
	    {
		System.err.println("");
		System.err.println("USAGE: krislet [-parameter value]");
		System.err.println("");
		System.err.println("    Parameters  value        default");
		System.err.println("   ------------------------------------");
		System.err.println("    host        host_name    localhost");
		System.err.println("    port        port_number  6000");
		System.err.println("    team        team_name    Kris");
		System.err.println("    proto       agent_proto  Krislet");
		System.err.println("");
		System.err.println("    Example:");
		System.err.println("      krislet -host www.host.com -port 6000 -team Poland -proto Krislet");
		System.err.println("    or");
		System.err.println("      krislet -host 193.117.005.223");
		return;
	    }

	Replicant player = new Replicant(InetAddress.getByName(hostName),
				     port, team, prototype);

	// enter main loop
	player.mainLoop();							
    }