summaryrefslogtreecommitdiffstats
path: root/šola/p1/wordle/Tekm_63230317_goljufija_SEME.java
blob: 34603e40e0dd103d17745cdd9b27758da0fc05ef (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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;
	}
}