<commit_before>import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;

public class Main {
    
    public static void main(String[] args) {
        
        BufferedReader reader;
        try{
            reader = new BufferedReader(new FileReader(args[0]));
        }

        catch(IOException ex) {
            System.out.println("File not found!");
            return;
        }

        String[] help;
        int n, m, numOfMids, i, j, min, next, cur;
        Point start1, start2, goal, temp, which;

        help = read(reader);
        n = Integer.parseInt(help[0]);
        m = Integer.parseInt(help[1]);

        help = read(reader);
        start1 = new Point(Integer.parseInt(help[0]),
                           Integer.parseInt(help[1]));

        help = read(reader);
        start2 = new Point(Integer.parseInt(help[0]), 
                           Integer.parseInt(help[1]));

        help = read(reader);
        goal = new Point(Integer.parseInt(help[0]), 
                         Integer.parseInt(help[1]));

        help = read(reader);
        numOfMids = Integer.parseInt(help[0]);

        Point[] midpoints = new Point[numOfMids];
        for (i = 0; i < numOfMids; i++) {
            help = read(reader);
            midpoints[i] = new Point(Integer.parseInt(help[0]), 
                                     Integer.parseInt(help[1]));
        }

        boolean[][] empty = new boolean[n][m];
        for (i = 0; i < n; i++) {
            String line;
            try {
                line = reader.readLine();
            }
            catch(IOException ex) {
                System.out.println("Something went wrong");
                return;
            }
            for (j = 0; j < m; j++) 
                if (line.charAt(j) == 'X')
                    empty[i][j] = false;
                else
                    empty[i][j] = true;
        }
        
        min = manhDist(start1, midpoints[0]);
        which = start1;
        for (i = 0; i < numOfMids; i++) {
            next = i;
            for (j = i+1; j < numOfMids; j++) {
                cur = manhDist(which, midpoints[j]);
                if (cur < min) {
                    min = cur;
                    next = j;
                }
            }
            temp = midpoints[i];
            midpoints[i] = midpoints[next];
            midpoints[next] = temp;
            which = midpoints[i];
        }

//         Monopati me metavlites point kai step  = Astar(start1, midpoints[0])

    }
    
    private static String[] read(BufferedReader r) {
        String line;
        try {
            line = r.readLine();
        }
        catch(IOException ex) {
            System.out.println("Wrong Input Format.");
            return null;
        }
        String[] nums = line.split(" ");
        return nums;
    }<commit_msg>Progressing<commit_after>import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;

public class Main {
    
    public static void main(String[] args) {
        
        BufferedReader reader;
        try{
            reader = new BufferedReader(new FileReader(args[0]));
        }

        catch(IOException ex) {
            System.out.println("File not found!");
            return;
        }

        String[] help;
        int n, m, numOfMids, i, j, min, next, cur;
        Point start1, start2, goal, temp, which;

        help = read(reader);
        n = Integer.parseInt(help[0]);
        m = Integer.parseInt(help[1]);

        help = read(reader);
        start1 = new Point(Integer.parseInt(help[0]),
                           Integer.parseInt(help[1]));

        help = read(reader);
        start2 = new Point(Integer.parseInt(help[0]), 
                           Integer.parseInt(help[1]));

        help = read(reader);
        goal = new Point(Integer.parseInt(help[0]), 
                         Integer.parseInt(help[1]));

        help = read(reader);
        numOfMids = Integer.parseInt(help[0]);

        Point[] midpoints = new Point[numOfMids];
        for (i = 0; i < numOfMids; i++) {
            help = read(reader);
            midpoints[i] = new Point(Integer.parseInt(help[0]), 
                                     Integer.parseInt(help[1]));
        }

        boolean[][] empty = new boolean[n][m];
        for (i = 0; i < n; i++) {
            String line;
            try {
                line = reader.readLine();
            }
            catch(IOException ex) {
                System.out.println("Something went wrong");
                return;
            }
            for (j = 0; j < m; j++) 
                if (line.charAt(j) == 'X')
                    empty[i][j] = false;
                else
                    empty[i][j] = true;
        }
        // Sorts midpoints according to what is closer to 
        // the previous one
        // TODO TESTING
        min = manhDist(start1, midpoints[0]);
        which = start1;
        for (i = 0; i < numOfMids; i++) {
            next = i;
            for (j = i+1; j < numOfMids; j++) {
                cur = manhDist(which, midpoints[j]);
                if (cur < min) {
                    min = cur;
                    next = j;
                }
            }
            temp = midpoints[i];
            midpoints[i] = midpoints[next];
            midpoints[next] = temp;
            which = midpoints[i];
        }
/*      
 *      int step = 0;
 *      ArrayList<Point> FirstPath;
 *      Astar astar = new Astar(start1, midpoints[0], step);
 *      FirstPath = astar.solve();
 *      for (i = 1; i < numOfMids; i++) {
 *          step = FirstPath.get(FirstPath.size() - 1).getStep() + 1;
 *          astar = new Astar(midpoints[i-1], midpoints[i], step);
 *          FirstPath = FirstPath.addAll(astar.solve());
 *      }
 */

    }
    
    private static String[] read(BufferedReader r) {
        String line;
        try {
            line = r.readLine();
        }
        catch(IOException ex) {
            System.out.println("Wrong Input Format.");
            return null;
        }
        String[] nums = line.split(" ");
        return nums;
    }
{'fraction_non_alphanumeric': 0.12895927601809956, 'fraction_numerical': 0.009211376858435682, 'mean_word_length': 1.3758157389635317, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1928928', 'n_tokens_mistral': 1813, 'n_tokens_neox': 1764, 'n_words': 417}