Ich habs jetzt so gelöst
Code:
public class Bsp11
{
public static void main(String[] args)
{
int[] kinder;
int n=1,s,arraylaenge,hilf,j,k=1; // n = children s = Steps
// get inputs
System.out.println("Bitte Anzahl der Kinder eingeben >0: ");
n += SavitchIn.readLineInt();
kinder = new int[n+1];
arraylaenge = n;
System.out.println("Bitte Schritte eingeben >0: ");
s = SavitchIn.readLineInt();
for (int i=1; i<=n; i++)
{
kinder[i] = i;
}
System.out.println(); //blank line
//The real work
for(int i=1;n > 1;i++) { //when all arrays are moved
//System.out.println(n);
//System.out.println();
System.out.println("next run");
j=1;
do { //till the run var is as large as the var that is the end of the search area
System.out.println("Ausgeschieden ist Kind: " + kinder[j]);
hilf = kinder[j];
kinder[j] = kinder[arraylaenge-k];
kinder[arraylaenge - k] = hilf;
//Checksets
System.out.println("Durchlauf: " + j);
System.out.println("n: " + n);
System.out.println("j: "+ j);
System.out.println();
//var increments
n--;
k++;
j+=s;
} while (j<n);
}