diff options
author | Anton Luka Šijanec <anton@sijanec.eu> | 2024-02-02 12:49:38 +0100 |
---|---|---|
committer | Anton Luka Šijanec <anton@sijanec.eu> | 2024-02-02 12:49:38 +0100 |
commit | 53b31c6ea98363871c7c6bdb8e662ad825e3f47a (patch) | |
tree | afb56424b413287bb9189a014475286bf06dc706 /šola/p1/učenje | |
parent | la2kol (diff) | |
download | r-53b31c6ea98363871c7c6bdb8e662ad825e3f47a.tar r-53b31c6ea98363871c7c6bdb8e662ad825e3f47a.tar.gz r-53b31c6ea98363871c7c6bdb8e662ad825e3f47a.tar.bz2 r-53b31c6ea98363871c7c6bdb8e662ad825e3f47a.tar.lz r-53b31c6ea98363871c7c6bdb8e662ad825e3f47a.tar.xz r-53b31c6ea98363871c7c6bdb8e662ad825e3f47a.tar.zst r-53b31c6ea98363871c7c6bdb8e662ad825e3f47a.zip |
Diffstat (limited to 'šola/p1/učenje')
-rw-r--r-- | šola/p1/učenje/Druga.java | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/šola/p1/učenje/Druga.java b/šola/p1/učenje/Druga.java new file mode 100644 index 0000000..2e86ac5 --- /dev/null +++ b/šola/p1/učenje/Druga.java @@ -0,0 +1,22 @@ +public class Druga { + public static boolean krizankaOK (char[][] besede, char[][] polozaji) { + char križanka[][] = new char[20][20]; + for (int i = 0; i < besede.length; i++) + for (int j = 0; j < besede[i].length; j++) { + int vrstica = polozaji[i][0]-'0'; + int stolpec = polozaji[i][1]-'0'; + if (polozaji[i][2] == 'v') + stolpec += j; + else + vrstica += j; + if (križanka[vrstica][stolpec] == '\000') { + križanka[vrstica][stolpec] = besede[i][j]; + continue; + } + if (križanka[vrstica][stolpec] == besede[i][j]) + continue; + return false; + } + return true; + } +} |