public static void main(String[] args) {
        if ((args.length < 1) || (args.length > 3)) {
            System.err.println("usage: " + Client.class.getName() + " <white|black> [[host:]port] [strategy]");
            System.exit(1);
        }
        
        PlayerType player = PlayerType.NONE;
        String host = DEFAULT_HOST;
        int port = DEFAULT_PORT;
        String strategy = DEFAULT_STRATEGY;
        
        if (args[0].startsWith("white")) {
            player = PlayerType.WHITE;
        } else if (args[0].startsWith("black")) {
            player = PlayerType.BLACK;
        } else {
            System.err.println("[client] invalid value for player");
            System.exit(1);
        }
        
        System.err.println("[client] player is " + player.toString());
        
        if (args.length >= 2) {
            String[] parts = args[1].split(":");
            if (parts.length == 1) {
                port = Integer.parseInt(parts[0]);
            } else {
                host = parts[0];
                port = Integer.parseInt(parts[1]);
            }
        }
        if (args.length == 3) {
            strategy = args[2]; 
        }
        
        // And, we're off!
        Player ai = null;
        try {
            ai = StrategyLookup.playerFromStrategy(strategy, player);
        } catch (IllegalArgumentException e) {
            System.err.println("[client] invalid strategy: " + strategy);
            System.exit(1);
        }
        Client mClient = new Client(player, host, port, ai);
        if (!mClient.connect()) {
            System.err.println("[client] unable to establish a connection, exiting");
            System.exit(1);
        }
        mClient.run();
    }