Follow along with the video below to see how to install our site as a web app on your home screen.
Anmerkung: this_feature_currently_requires_accessing_site_using_safari
Ahja hm. Habs icht ganz gecheckt, trag mich aber bitte ein. Aber ich kann leider keine Videos hochladen, und TS3 oder so hab ich auch nicht
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
public class Test {
public static void main(String[] args) {
ArrayList<String> result = shuffel(read());
for(int i = 0; i < result.size(); i++) {
System.out.print((1+i)+": ");
System.out.println(result.get(i));
}
write(result);
}
private static ArrayList<String> shuffel(ArrayList<String> in) {
ArrayList<String> retValue = new ArrayList<String>();
while(in.size() > 0) {
int rnd = (int)(Math.random() * in.size());
retValue.add(in.get(rnd));
in.remove(rnd);
}
return retValue;
}
private static ArrayList<String> read() {
BufferedReader reader = null;
ArrayList<String> retValue = new ArrayList<String>();
try {
reader = new BufferedReader(new FileReader("C:/spieler.txt"));
} catch (IOException e) {}
try {
String zeile = reader.readLine();
while(zeile != null) {
retValue.add(zeile);
zeile = reader.readLine();
}
} catch (IOException e) {}
System.out.println(retValue.size()+" Datensaetze eingelesen.");
return retValue;
}
private static void write(ArrayList<String> in) {
try {
BufferedWriter out = new BufferedWriter(new FileWriter("C:/out.txt"));
int i = 1;
while(in.size() > 0) {
out.write(i++ + ": ");
out.write(in.get(0));
out.newLine();
in.remove(0);
}
out.close();
} catch (IOException e) {}
}
}