From b0324289066876915efb84a133eca039d8e8c8ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20Luka=20=C5=A0ijanec?= Date: Sun, 17 Dec 2023 23:17:03 +0100 Subject: =?UTF-8?q?=C5=A1ola?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- prog/aoc/23/12/1.py | 53 ++++++++++ prog/aoc/23/12/correct.txt | 6 ++ prog/aoc/23/12/in.txt | 6 ++ prog/aoc/23/13/1.py | 22 +++++ prog/skovikanje/skovik/test.html | 15 +++ "prog/\305\276/QR-Code-generator" | 2 +- skripti/.gitignore | 2 + "\305\241ola/ds1/kolokvij1.lyx" | 179 +++++++++++++++++++++++++++------- "\305\241ola/p1/dn/6/Premica.java" | 50 ++++++++++ "\305\241ola/p1/dn/6/Tocka.java" | 27 +++++ "\305\241ola/p1/dn/7/Blok.java" | 33 +++++++ "\305\241ola/p1/dn/7/Oseba.java" | 17 ++++ "\305\241ola/p1/dn/7/Stanovanje.java" | 95 ++++++++++++++++++ "\305\241ola/p1/dn/Premica.java" | 50 ---------- "\305\241ola/p1/dn/Tocka.java" | 27 ----- "\305\241ola/p1/dn/tj.sh" | 2 +- 16 files changed, 472 insertions(+), 114 deletions(-) create mode 100755 prog/aoc/23/12/1.py create mode 100644 prog/aoc/23/12/correct.txt create mode 100644 prog/aoc/23/12/in.txt create mode 100755 prog/aoc/23/13/1.py create mode 100644 skripti/.gitignore create mode 100644 "\305\241ola/p1/dn/6/Premica.java" create mode 100644 "\305\241ola/p1/dn/6/Tocka.java" create mode 100644 "\305\241ola/p1/dn/7/Blok.java" create mode 100644 "\305\241ola/p1/dn/7/Oseba.java" create mode 100644 "\305\241ola/p1/dn/7/Stanovanje.java" delete mode 100644 "\305\241ola/p1/dn/Premica.java" delete mode 100644 "\305\241ola/p1/dn/Tocka.java" diff --git a/prog/aoc/23/12/1.py b/prog/aoc/23/12/1.py new file mode 100755 index 0000000..7e07935 --- /dev/null +++ b/prog/aoc/23/12/1.py @@ -0,0 +1,53 @@ +#!/usr/bin/python3 +springs = [] +try: + while True: + s = input() + springs.append((s.split(" ")[0], list(map(int, s.split(" ")[1].split(","))))) +except EOFError: + pass +def counts(vhod): + s = vhod + "$" + prev = None + r = [] + run = 0 + for c in s: + if prev == None: + prev = c + run = 1 + continue + if c == prev: + run += 1 + continue + if prev == "#": + r.append(run) + prev = c + run = 1 + return r +""" +for spring in springs: + print(counts(spring[0]), spring[1]) +""" +def possibilities(x): + r = 0 + countq = x[0].count("?") + for bits in range(2**countq): + copy = x[0] + for i in range(countq): + if bits & (1 << i): + copy = copy.replace("?", ".", 1) + else: + copy = copy.replace("?", "#", 1) + if counts(copy) == x[1]: + r += 1 + return r +def possibilities_serial(array): + s = 0 + for element in array: + s += possibilities(element) + return s +batch_size = 10 +batches = [springs[x:x+batch_size] for x in range(0, len(springs), batch_size)] +from multiprocessing import Pool +with Pool(len(batches)) as p: + print(sum(p.map(possibilities_serial, batches))) diff --git a/prog/aoc/23/12/correct.txt b/prog/aoc/23/12/correct.txt new file mode 100644 index 0000000..e2bdf5e --- /dev/null +++ b/prog/aoc/23/12/correct.txt @@ -0,0 +1,6 @@ +#.#.### 1,1,3 +.#...#....###. 1,1,3 +.#.###.#.###### 1,3,1,6 +####.#...#... 4,1,1 +#....######..#####. 1,6,5 +.###.##....# 3,2,1 diff --git a/prog/aoc/23/12/in.txt b/prog/aoc/23/12/in.txt new file mode 100644 index 0000000..e925935 --- /dev/null +++ b/prog/aoc/23/12/in.txt @@ -0,0 +1,6 @@ +???.### 1,1,3 +.??..??...?##. 1,1,3 +?#?#?#?#?#?#?#? 1,3,1,6 +????.#...#... 4,1,1 +????.######..#####. 1,6,5 +?###???????? 3,2,1 diff --git a/prog/aoc/23/13/1.py b/prog/aoc/23/13/1.py new file mode 100755 index 0000000..14f231e --- /dev/null +++ b/prog/aoc/23/13/1.py @@ -0,0 +1,22 @@ +#!/usr/bin/python3 +from sys import stdin +data = stdin.read()[:-1] +patterns = [] +for datum in data.split("\n\n"): + patterns.append(datum.split("\n")) +def try_gap(pattern, gap): + for l in range(gap+1): + if pattern[gap-l] != pattern[line+l+1]: + return False + return True +def transpose(pattern): + r = [] + for column in range(len(pattern[0])): + l = "" + for line in range(len(pattern)): + l += pattern[line][column] + r.append(l) + return r +for pattern in patterns: + for line in len(pattern): + try_line(line diff --git a/prog/skovikanje/skovik/test.html b/prog/skovikanje/skovik/test.html index 67c6136..bf3220a 100644 --- a/prog/skovikanje/skovik/test.html +++ b/prog/skovikanje/skovik/test.html @@ -7,6 +7,11 @@ a { overflow-wrap: break-word; } +html { + margin: auto; + max-width: 60em; + text-align: justify; +} @@ -72,6 +77,16 @@ skovik the type of word that drake would use +OAV dne sob 25 nov 2023 23:55:16 CET uredi na
+
+ +
+z6nz dne tor 28 nov 2023 12:44:26 CET uredi na +
+ +
+ +loading demo za un cursed ass.si link +
pokaži/skrij
diff --git "a/prog/\305\276/QR-Code-generator" "b/prog/\305\276/QR-Code-generator" index 22fac31..49a66a2 160000 --- "a/prog/\305\276/QR-Code-generator" +++ "b/prog/\305\276/QR-Code-generator" @@ -1 +1 @@ -Subproject commit 22fac31bdf81da68730c177c0e931c93234d2a30 +Subproject commit 49a66a2b8bb8f8852fd2e1deb00b8672f5760139 diff --git a/skripti/.gitignore b/skripti/.gitignore new file mode 100644 index 0000000..c73a7f5 --- /dev/null +++ b/skripti/.gitignore @@ -0,0 +1,2 @@ +code128 +črtna_koda diff --git "a/\305\241ola/ds1/kolokvij1.lyx" "b/\305\241ola/ds1/kolokvij1.lyx" index 01421eb..1df6ebc 100644 --- "a/\305\241ola/ds1/kolokvij1.lyx" +++ "b/\305\241ola/ds1/kolokvij1.lyx" @@ -68,7 +68,7 @@ enumitem \color #008000 \end_index \leftmargin 1cm -\topmargin 0cm +\topmargin 1cm \rightmargin 1cm \bottommargin 2cm \headheight 1cm @@ -94,33 +94,6 @@ enumitem \begin_body -\begin_layout Title -List s formulami za 1. - kolokvij Diskretnih struktur 1 -\end_layout - -\begin_layout Author - -\noun on -Anton Luka Šijanec -\end_layout - -\begin_layout Date -\begin_inset ERT -status open - -\begin_layout Plain Layout - - -\backslash -today -\end_layout - -\end_inset - - -\end_layout - \begin_layout Standard \begin_inset ERT status open @@ -353,7 +326,7 @@ Rightarrow C & \backslash vDash A \backslash -Rightarrow B && +Rightarrow C && \backslash text{ \backslash @@ -538,14 +511,100 @@ Množice \end_layout \begin_layout Standard -\begin_inset Formula $^{\mathcal{C}},\cup\backslash,\cup\oplus$ +\begin_inset Formula $^{\mathcal{C}},\cap\backslash,\cup\oplus$ \end_inset (left to right) \end_layout \begin_layout Standard -\begin_inset Formula $\mathcal{A}\subseteq\mathcal{B}\Leftrightarrow\mathcal{A}\cup\mathcal{B}=\mathcal{B}\Leftrightarrow\mathcal{A}\cup\mathcal{B}=\mathcal{A}\Leftrightarrow\mathcal{A}\backslash\mathcal{B}=\left\{ \right\} \Leftrightarrow\mathcal{B}^{\mathcal{C}}\subseteq\mathcal{A^{\mathcal{C}}}$ +Distributivnost: +\begin_inset Formula $\cup\cap$ +\end_inset + +, +\begin_inset Formula $\cap\cup$ +\end_inset + +, +\begin_inset Formula $\left(\mathcal{A}\oplus\mathcal{B}\right)\cap\mathcal{C}=\left(\mathcal{A\cap\mathcal{C}}\right)\oplus\left(\mathcal{B}\cap\mathcal{C}\right)$ +\end_inset + + +\end_layout + +\begin_layout Standard +Asociativnost: +\begin_inset Formula $\oplus\cup\cap$ +\end_inset + +. + Distributivnost: +\begin_inset Formula $\oplus\cup\cap$ +\end_inset + + +\end_layout + +\begin_layout Standard +Absorbcija: +\begin_inset Formula $\mathcal{A}\cup\left(\mathcal{A}\cap\mathcal{B}\right)=\mathcal{A}=A\cap\left(\mathcal{A}\cup\mathcal{B}\right)$ +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Formula $\mathcal{A}\subseteq\mathcal{B}\Leftrightarrow\mathcal{A}\cup\mathcal{B}=\mathcal{B}\Leftrightarrow\mathcal{A}\cup\mathcal{B}=\mathcal{A}\Leftrightarrow\mathcal{A}\backslash\mathcal{B}=\emptyset\Leftrightarrow\mathcal{B}^{\mathcal{C}}\subseteq\mathcal{A^{\mathcal{C}}}$ +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Formula $\mathcal{A}=\mathcal{B}\Longleftrightarrow\mathcal{A\oplus\mathcal{B}}=\emptyset$ +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Formula $\mathcal{A}=\emptyset\wedge\mathcal{B}=\emptyset\Longleftrightarrow\mathcal{A}\cup\mathcal{B}=\emptyset$ +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Formula $\left(\mathcal{X}\cap\mathcal{P}\right)\cup\left(\mathcal{X^{C}}\cap\mathcal{Q}\right)=\emptyset\Longleftrightarrow\text{\ensuremath{\mathcal{Q\subseteq X}\subseteq\mathcal{P^{C}}}}$ +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Formula $\mathcal{A}\backslash\mathcal{B}\sim\mathcal{A}\cap\mathcal{B}^{C}$ +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Formula $\mathcal{X}\cup\mathcal{X^{C}}=\emptyset$ +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Formula $\mathcal{W}=\mathcal{W}\cap\mathcal{U}=\mathcal{W\cap}\left(\mathcal{X}\cup\mathcal{X^{C}}\right)=\left(\mathcal{W}\cap\mathcal{X}\right)\cup\left(\mathcal{W}\cap\mathcal{X^{C}}\right)$ +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Formula $\mathcal{A}\oplus\mathcal{B}=\left(\mathcal{A}\backslash\mathcal{B}\right)\cup\left(\mathcal{B\backslash\mathcal{A}}\right)$ \end_inset @@ -557,6 +616,10 @@ Množice Lastnosti binarnih relacij \end_layout +\begin_layout Standard + +\end_layout + \begin_layout Paragraph \begin_inset ERT status open @@ -1027,7 +1090,7 @@ Faktorska množica: \end_layout \begin_layout Standard -\begin_inset Formula $\vec{\mathcal{B}}\text{ razbitje}A\Longleftrightarrow\bigcup_{i}\mathcal{B}_{i}=A\wedge\forall i\mathcal{B}_{i}\not=\left\{ \right\} \wedge\mathcal{B}_{i}\cap\mathcal{B}_{j}=\left\{ \right\} ,i\not=j$ +\begin_inset Formula $\vec{\mathcal{B}}\text{ razbitje}A\Longleftrightarrow\bigcup_{i}\mathcal{B}_{i}=A\wedge\forall i\mathcal{B}_{i}\not=\emptyset\wedge\mathcal{B}_{i}\cap\mathcal{B}_{j}=\emptyset,i\not=j$ \end_inset @@ -1109,12 +1172,58 @@ Srečno! \end_layout \begin_layout Paragraph -TODO +Funkcijska polnost \end_layout \begin_layout Standard -Postovi teoremi za funkcijsko polnost, množice, preglej še zapiske s pisalnega - stroja. +\begin_inset Formula $T_{0},$ +\end_inset + + +\begin_inset Formula $T_{1}$ +\end_inset + +, +\begin_inset Formula $S$ +\end_inset + + – +\begin_inset Formula $f\left(\vec{x}\right)=\neg f\left(\vec{x}\oplus\vec{1}\right)$ +\end_inset + +, +\begin_inset Formula $L$ +\end_inset + +, +\begin_inset Formula $M$ +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Formula $L$ +\end_inset + + – +\begin_inset Formula $f\left(\vec{x}\right)=\left[\begin{array}{ccc} +a_{0} & \dots & a_{n}\end{array}\right]^{T}\oplus\wedge\left[\begin{array}{cccc} +1 & x_{1} & \dots & x_{n}\end{array}\right]$ +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Formula $M$ +\end_inset + + – +\begin_inset Formula $\forall i,j:\vec{w_{i}}<\vec{w_{j}}\Rightarrow f\left(\vec{w_{i}}\right)\leq f\left(\vec{w_{j}}\right)$ +\end_inset + + \end_layout \begin_layout Standard diff --git "a/\305\241ola/p1/dn/6/Premica.java" "b/\305\241ola/p1/dn/6/Premica.java" new file mode 100644 index 0000000..2d2ec4e --- /dev/null +++ "b/\305\241ola/p1/dn/6/Premica.java" @@ -0,0 +1,50 @@ +import java.util.*; +public class Premica { + private double k; + private double n; + public Premica(double k, double n) { + this.k = k; + this.n = n; + } + public double vrniK() { + return this.k; + } + public double vrniN() { + return this.n; + } + public String toString() { + return String.format(Locale.ROOT, "y = %.2f x + %.2f", this.k, this.n); + } + public Tocka tockaPriX(double x) { + return new Tocka(x, this.k*x+this.n); + } + public static Premica skoziTocko(double k, Tocka t) { + return new Premica(k, t.vrniY()-k*t.vrniX()); + } + + public Premica vzporednica(Tocka t) { + return skoziTocko(this.k, t); + } + + public Premica pravokotnica(Tocka t) { + return skoziTocko(-1/this.k, t); + } + + public Tocka presecisce(Premica p, double epsilon) { + if (Math.abs(this.k - p.vrniK()) < epsilon) + return null; + return tockaPriX((this.n-p.vrniN())/(p.vrniK()-this.k)); + } + public Tocka projekcija(Tocka t) { + return presecisce(pravokotnica(t), 0); + } + public double razdalja(Tocka t) { + return t.razdalja(projekcija(t)); + } + public double razdaljaOdIzhodisca() { + return Tocka.izhodisce().razdalja(projekcija(Tocka.izhodisce())); + } + public double razdalja(double n) { + return new Premica(this.k, n).razdalja(tockaPriX(0)); + } +} diff --git "a/\305\241ola/p1/dn/6/Tocka.java" "b/\305\241ola/p1/dn/6/Tocka.java" new file mode 100644 index 0000000..8dce30b --- /dev/null +++ "b/\305\241ola/p1/dn/6/Tocka.java" @@ -0,0 +1,27 @@ +import java.util.*; +public class Tocka { + private double x; + private double y; + public Tocka(double x, double y) { + this.x = x; + this.y = y; + } + public double vrniX() { + return this.x; + } + public double vrniY() { + return this.y; + } + public String toString() { + return String.format(Locale.ROOT, "(%.2f, %.2f)", this.x, this.y); + } + public static Tocka izhodisce() { + return new Tocka(0, 0); + } + public double razdalja(Tocka t) { + return Math.sqrt(Math.pow(this.x-t.x, 2)+Math.pow(this.y-t.y, 2)); + } + public double razdaljaOdIzhodisca() { + return izhodisce().razdalja(this); + } +} diff --git "a/\305\241ola/p1/dn/7/Blok.java" "b/\305\241ola/p1/dn/7/Blok.java" new file mode 100644 index 0000000..2ac1863 --- /dev/null +++ "b/\305\241ola/p1/dn/7/Blok.java" @@ -0,0 +1,33 @@ +import java.util.*; +public class Blok { + private Stanovanje stanovanje; + public Blok(Stanovanje stanovanje) { + this.stanovanje = stanovanje; + } + public Oseba starosta() { + return this.stanovanje.starostaSosescine(); + } + public int[][] razporeditev() { + int minx = Integer.MAX_VALUE; + int maxx = Integer.MIN_VALUE; + int miny = Integer.MAX_VALUE; + int maxy = Integer.MIN_VALUE; + for (int[] tuple : stanovanje.pozicije()) { + if (tuple[1] > maxx) + maxx = tuple[1]; + if (tuple[2] > maxy) + maxy = tuple[2]; + if (tuple[1] < minx) + minx = tuple[1]; + if (tuple[2] < miny) + miny = tuple[2]; + } + int[][] r = new int[maxx-minx+1][maxy-miny+1]; + for (int i = 0; i < r.length; i++) + for (int j = 0; j < r[i].length; j++) + r[i][j] = -1; + for (int[] tuple : stanovanje.pozicije()) + r[tuple[1]-minx][tuple[2]-miny] = tuple[0]; // TODO think again + return r; + } +} diff --git "a/\305\241ola/p1/dn/7/Oseba.java" "b/\305\241ola/p1/dn/7/Oseba.java" new file mode 100644 index 0000000..2477ee9 --- /dev/null +++ "b/\305\241ola/p1/dn/7/Oseba.java" @@ -0,0 +1,17 @@ +import java.util.*; +public class Oseba { + private String ip; + public char spol; + public int starost; + public Oseba(String ip, char spol, int starost) { + this.ip = ip; + this.spol = spol; + this.starost = starost; + } + public String toString() { + return String.format("%s, %c, %d", this.ip, this.spol, this.starost); + } + public boolean jeStarejsaOd(Oseba os) { + return this.starost > os.starost; + } +} diff --git "a/\305\241ola/p1/dn/7/Stanovanje.java" "b/\305\241ola/p1/dn/7/Stanovanje.java" new file mode 100644 index 0000000..30db09f --- /dev/null +++ "b/\305\241ola/p1/dn/7/Stanovanje.java" @@ -0,0 +1,95 @@ +import java.util.*; +public class Stanovanje { + public Oseba[] stanovalci; + private Stanovanje[] sosedje = {null, null, null, null}; + public Stanovanje(Oseba[] stanovalci) { + this.stanovalci = stanovalci; + } + public int steviloStanovalcev() { + return this.stanovalci.length; + } + public int steviloStarejsihOd(Oseba os) { + int r = 0; + for (int i = 0; i < this.stanovalci.length; i++) + if (this.stanovalci[i].jeStarejsaOd(os)) + r++; + return r; + } + public int[] mz() { + int mž[] = {0, 0}; + for (int i = 0; i < this.stanovalci.length; i++) + if (this.stanovalci[i].spol == 'M') + mž[0]++; + else + mž[1]++; + return mž; + } + public Oseba starosta() { + Oseba r = null; + for (int i = 0; i < this.stanovalci.length; i++) + if (r == null || this.stanovalci[i].jeStarejsaOd(r)) + r = this.stanovalci[i]; + return r; + } + public void nastaviSosede(Stanovanje levi, Stanovanje zgornji, + Stanovanje desni, Stanovanje spodnji) { + this.sosedje[0] = levi; + this.sosedje[1] = zgornji; + this.sosedje[2] = desni; + this.sosedje[3] = spodnji; + } + public Oseba starostaSosescine() { + Oseba r = this.starosta(); + for (int i = 0; i < this.sosedje.length; i++) { + if (this.sosedje[i] == null) + continue; + if (this.sosedje[i].starosta() == null) + continue; + if (this.sosedje[i].starosta().jeStarejsaOd(r)) + r = this.sosedje[i].starosta(); + } + return r; + } + public Oseba[] sosedjeSosedov() { + List r = new ArrayList(); + for (Stanovanje stanovanje : this.soseščina()) + r.addAll(Arrays.asList(stanovanje.stanovalci)); + return r.toArray(new Oseba[0]); + } + private Set soseščina() { + return this.soseščina(new HashSet()); + } + private Set soseščina(Set obiskani) { + Set r = new HashSet(); + if (obiskani.contains(this)) + return r; + r.addAll(Arrays.asList(this.sosedje)); + r.remove(null); + obiskani.add(this); + for (int i = 0; i < this.sosedje.length; i++) + if (this.sosedje[i] != null) + r.addAll(this.sosedje[i].soseščina(obiskani)); + obiskani.remove(this); + return r; + } + public Set pozicije () { + return this.pozicije(new HashSet(), 0, 0); + } + private Set pozicije (Set obiskani, int x, int y) { + Set r = new HashSet(); + if (obiskani.contains(this)) + return r; + r.add(new int[]{this.stanovalci.length, x, y}); + obiskani.add(this); + if (this.sosedje[0] != null) + r.addAll(this.sosedje[0].pozicije(obiskani, x-1, y)); + if (this.sosedje[1] != null) + r.addAll(this.sosedje[1].pozicije(obiskani, x, y+1)); + if (this.sosedje[2] != null) + r.addAll(this.sosedje[2].pozicije(obiskani, x+1, y)); + if (this.sosedje[3] != null) + r.addAll(this.sosedje[3].pozicije(obiskani, x, y-1)); + obiskani.remove(this); + return r; + } + } diff --git "a/\305\241ola/p1/dn/Premica.java" "b/\305\241ola/p1/dn/Premica.java" deleted file mode 100644 index 2d2ec4e..0000000 --- "a/\305\241ola/p1/dn/Premica.java" +++ /dev/null @@ -1,50 +0,0 @@ -import java.util.*; -public class Premica { - private double k; - private double n; - public Premica(double k, double n) { - this.k = k; - this.n = n; - } - public double vrniK() { - return this.k; - } - public double vrniN() { - return this.n; - } - public String toString() { - return String.format(Locale.ROOT, "y = %.2f x + %.2f", this.k, this.n); - } - public Tocka tockaPriX(double x) { - return new Tocka(x, this.k*x+this.n); - } - public static Premica skoziTocko(double k, Tocka t) { - return new Premica(k, t.vrniY()-k*t.vrniX()); - } - - public Premica vzporednica(Tocka t) { - return skoziTocko(this.k, t); - } - - public Premica pravokotnica(Tocka t) { - return skoziTocko(-1/this.k, t); - } - - public Tocka presecisce(Premica p, double epsilon) { - if (Math.abs(this.k - p.vrniK()) < epsilon) - return null; - return tockaPriX((this.n-p.vrniN())/(p.vrniK()-this.k)); - } - public Tocka projekcija(Tocka t) { - return presecisce(pravokotnica(t), 0); - } - public double razdalja(Tocka t) { - return t.razdalja(projekcija(t)); - } - public double razdaljaOdIzhodisca() { - return Tocka.izhodisce().razdalja(projekcija(Tocka.izhodisce())); - } - public double razdalja(double n) { - return new Premica(this.k, n).razdalja(tockaPriX(0)); - } -} diff --git "a/\305\241ola/p1/dn/Tocka.java" "b/\305\241ola/p1/dn/Tocka.java" deleted file mode 100644 index 8dce30b..0000000 --- "a/\305\241ola/p1/dn/Tocka.java" +++ /dev/null @@ -1,27 +0,0 @@ -import java.util.*; -public class Tocka { - private double x; - private double y; - public Tocka(double x, double y) { - this.x = x; - this.y = y; - } - public double vrniX() { - return this.x; - } - public double vrniY() { - return this.y; - } - public String toString() { - return String.format(Locale.ROOT, "(%.2f, %.2f)", this.x, this.y); - } - public static Tocka izhodisce() { - return new Tocka(0, 0); - } - public double razdalja(Tocka t) { - return Math.sqrt(Math.pow(this.x-t.x, 2)+Math.pow(this.y-t.y, 2)); - } - public double razdaljaOdIzhodisca() { - return izhodisce().razdalja(this); - } -} diff --git "a/\305\241ola/p1/dn/tj.sh" "b/\305\241ola/p1/dn/tj.sh" index dcb1270..908f082 100755 --- "a/\305\241ola/p1/dn/tj.sh" +++ "b/\305\241ola/p1/dn/tj.sh" @@ -33,7 +33,7 @@ do tac $f | tac echo "IZHOD: Levo je vaš izhod, desno je pravilen izhod:" head -n-1 <<<$out - grep 'java$' <<<$f > /dev/null && echo "PRIPOROČILO: Če DN zahteva razrede (kot recimo DN06), morate imeti v trenutnem direktoriju PREVEDENE .class datoteke vaših zahtevanih razredov. Če so v katerem drugem direktoriju, morate nastaviti CLASSPATH." + grep 'java$' <<<$f > /dev/null && echo -e "PRIPOROČILO: Če DN zahteva razrede (kot recimo DN06), morate imeti v trenutnem direktoriju PREVEDENE .class datoteke vaših zahtevanih razredov. Če so v katerem drugem direktoriju, morate nastaviti CLASSPATH.\nPoleg tega se lahko zgodi, da v direktoriju s testi obstaja TestSkupno.java (kot recimo DN07), ki ga je potrebno prevesti v z javac." fi else uspelih=$(($uspelih+1)) -- cgit v1.2.3