diff options
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; + } +} |