package domain; import robot.exceptions.RobotException; import robot.exceptions.RobotIllegalStateException; import robot.exceptions.RobotMagicValueException; import java.util.Arrays; import java.util.List; import java.util.OptionalInt; import java.util.function.IntPredicate; import java.util.stream.Collector; import java.util.stream.Collectors; public class R2D2 extends RobotBasics { /** * * @param id> int * @param name> String */ public R2D2(int id, String name){ super(id, name); } /*Sorting sort = (int[] input) -> { int small; for(int i = 0; i < input.length -1; i++){ small = i; for(int j = i + 1; j < input.length; j++){ if(input[j] < ) } } }*/ public int[] think(int[] zahlen) throws RobotException { if(isPowerOn()){ return sorting(zahlen); }else{ throw new RobotIllegalStateException(getName() + " is turned off!"); } } public int[] sorting(int[] arr) { //Selectionsort int small; for (int i = 0; i