Skip to content

Instantly share code, notes, and snippets.

@companje
Created December 30, 2011 15:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save companje/1540254 to your computer and use it in GitHub Desktop.
Save companje/1540254 to your computer and use it in GitHub Desktop.
String lines[];
String invoer = "";
void setup() {
size(500,500);
strokeWeight(2);
lines = loadStrings("netnummers.txt");
}
void draw() {
background(0);
for (int i=0; i<lines.length; i++) {
String[] nums = split(lines[i], '\t');
float x = map(float(nums[1]), 400, 15000, 0, width);
float y = map(float(nums[0]), 400, 13000, height, 0);
String kengetal = nums[2];
if (kengetal.indexOf(invoer)==0) {
stroke(255,255,0);
} else {
stroke(100);
}
point(x,y);
}
text(invoer, 10, 15);
}
void keyPressed() {
invoer += key;
if (key==8 && invoer.length()>0) {
invoer = invoer.substring(0, invoer.length()-2);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment