public void runTest(File f, AI ai, AI ai2) throws FileNotFoundException,
            UnsupportedEncodingException,
            IOException {
        FileWriter out = new FileWriter(f, true);
        int wins = 0;
        int ties = 0;
        int loss = 0;

        for (int g = 0; g < numGames; g++) {
            double[] board = new double[12 * 4];
            int player = (Math.random() > .5) ? 1 : 2;
            int player2 = (player == 1) ? 2 : 1;
            do {
                if (player == 1) {
                    board = ai.exploit(board, player);
                    if (Winchecker.check(board) > 0) {
                        break;
                    }
                    board = ai2.exploit(board, player2);
                } else {
                    board = ai2.exploit(board, player2);
                    if (Winchecker.check(board) > 0) {
                        break;
                    }
                    board = ai.exploit(board, player);
                }
            } while (Winchecker.check(board) < 0);
            if (Winchecker.check(board) == player) {
                wins++;
            } else {
                if (Winchecker.check(board) == player2) {
                    loss++;
                } else {
                    ties++;
                }
            }
        }
        System.out.println("Finished " + ai.getName() + " against " + ai2.getName());
        out.write(ai2.getName() + "," + wins + "," + ties + "," + loss + "\n");
        out.close();
    }