Created
April 21, 2012 17:19
-
-
Save atduskgreg/2438543 to your computer and use it in GitHub Desktop.
Processing sketch demonstrating keeping track of pressed keys in an ArrayList
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
ArrayList answers; | |
int currentString = -1; | |
void setup(){ | |
answers = new ArrayList(); | |
} | |
void draw(){ | |
if(answers.size() > 0){ | |
String q1 = (String)answers.get(currentString); | |
println(q1); | |
println(answers); | |
} | |
} | |
void keyPressed(){ | |
answers.add("" + key); | |
currentString++; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment