summaryrefslogtreecommitdiffstats
path: root/šola/p1/wordle/Tekm_63230317_goljufija_SEME.java
diff options
context:
space:
mode:
authorAnton Luka Šijanec <anton@sijanec.eu>2024-02-02 12:49:38 +0100
committerAnton Luka Šijanec <anton@sijanec.eu>2024-02-02 12:49:38 +0100
commit53b31c6ea98363871c7c6bdb8e662ad825e3f47a (patch)
treeafb56424b413287bb9189a014475286bf06dc706 /šola/p1/wordle/Tekm_63230317_goljufija_SEME.java
parentla2kol (diff)
downloadr-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/wordle/Tekm_63230317_goljufija_SEME.java')
-rw-r--r--šola/p1/wordle/Tekm_63230317_goljufija_SEME.java28
1 files changed, 28 insertions, 0 deletions
diff --git a/šola/p1/wordle/Tekm_63230317_goljufija_SEME.java b/šola/p1/wordle/Tekm_63230317_goljufija_SEME.java
new file mode 100644
index 0000000..34603e4
--- /dev/null
+++ b/šola/p1/wordle/Tekm_63230317_goljufija_SEME.java
@@ -0,0 +1,28 @@
+import java.util.*;
+public class Tekm_63230317_goljufija_SEME implements Stroj {
+ List<String> lstBesede = new ArrayList<String>();
+ @Override
+ public void inicializiraj(Set<String> besede) {
+ this.lstBesede = new ArrayList<>(besede);
+ boolean ukradel = false;
+ Integer seme = null;
+ for (String arg : ProcessHandle.current().info().arguments().get())
+ try {
+ seme = Integer.parseInt(arg);
+ } catch (Exception ex) {
+
+ }
+ if (seme == null)
+ throw new RuntimeException("ni mi uspelo ukrasti semena!!!");
+ Collections.shuffle(this.lstBesede, new Random(seme));
+ }
+ @Override
+ public String poteza(List<Character> odziv) {
+ if (odziv == null) {
+ String beseda = lstBesede.get(0);
+ lstBesede.remove(0);
+ return beseda;
+ }
+ return null;
+ }
+}