Created
October 8, 2017 14:26
-
-
Save superboum/0733fc5ccbd71aa394411ef754cbe9c8 to your computer and use it in GitHub Desktop.
Some processing snippets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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