package sk.upjs.paz.prednaska07;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import sk.upjs.jpaz2.*;
public class Launcher {
        public static void main(String[] args) {
                SmartTurtle franklin = new SmartTurtle();
                int[] arr = { 1, 2, 3 };
                int res = franklin.prefixSum(null, -7);
                System.out.println(res);
                // 8.0 / 0 vrati Infinity, 0.0 / 0 vrati NaN - not a number
                double a = 0.0 / 0;
                System.out.println(a);
                String s = "123 32 a32 \"45 6488888888888888888888888888888888888888888888888 -23";
                System.out.println(franklin.maximum(s));
                File folder = new File("/home/miro/eclipse-workspace/PAZ1a2021/prednaska07");
                franklin.ls(folder);
                franklin.printXml(folder);
                File file = new File("hello.txt");
                /*
                PrintWriter pw = null;
                try {
                        pw = new PrintWriter(file);
                        pw.println("hello world");
                } catch (FileNotFoundException e) {
                        e.printStackTrace();
                } finally {
                        if (pw != null)
                                pw.close();
                }*/
                try (PrintWriter pw = new PrintWriter(file)) {
                        pw.println("hello");
                } catch (FileNotFoundException e) {
                        e.printStackTrace();
                }
                int[] array = { 1, 2, 8, -34 };
                franklin.saveNumbersToFile(new File("numbers.txt"), array);
        }
}