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/wordle/Tekm_63230317_goljufija_SEME.java | |
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/wordle/Tekm_63230317_goljufija_SEME.java')
-rw-r--r-- | šola/p1/wordle/Tekm_63230317_goljufija_SEME.java | 28 |
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; + } +} |