public void toFile(String[] args, String outfile) {
        try (
                FileOutputStream fOutStream = new FileOutputStream(new File(outfile), false);
        ) {
            Labyrinth laby = new Labyrinth(Integer.parseInt(args[2]), Integer.parseInt(args[3]));
            ObjectOutputStream oOutStream = new ObjectOutputStream(fOutStream);
            oOutStream.writeObject(laby);
            oOutStream.flush();
        } catch (FileNotFoundException e) {
            System.out.println("Invalid file path !");
        } catch (Exception e) {
            System.out.println("Unknown error !");
        }
    }