Skip to content

Instantly share code, notes, and snippets.

@superboum
Created October 8, 2017 14:26
Show Gist options
  • Save superboum/0733fc5ccbd71aa394411ef754cbe9c8 to your computer and use it in GitHub Desktop.
Save superboum/0733fc5ccbd71aa394411ef754cbe9c8 to your computer and use it in GitHub Desktop.
Some processing snippets
void setup() {
BufferedReader reader;
reader = createReader("euler.txt");
ArrayList<Integer> nombres = new ArrayList<Integer>();
while (true) {
try {
int lu = reader.read();
if (lu == -1) {
break;
} else {
if (lu >= 48 && lu <= 57) { // Cf un tableau ASCII, 48 = code ASCII pour 0
nombres.add(lu-48);
}
}
} catch (Exception e) {
println("Erreur", e);
return;
}
}
println(nombres);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment