summaryrefslogblamecommitdiffstats
path: root/šola/p1/wordle/Tekm_63230317_goljufija_SEME.java
blob: 34603e40e0dd103d17745cdd9b27758da0fc05ef (plain) (tree)



























                                                                                     
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;
	}
}