I've got a sketch here wich is supposed to draw triangles like a 'hexagonal-concentric-snail'
http://studio.sketchpad.cc/sp/pad/view/4nB53waVBp/latest (I give you the sketchpad version beacause the code don't run in Processing plus i need it in PJS)
You can see that all the colored triangle are placed manually, after the last position
int w = triangleWidth;
int h = triangleHeight;
alTrianglesOffset.add({w, 0}); // goes right from the 1st position
alTrianglesOffset.add({0, h/2}); // goes down from the last position
alTrianglesOffset.add({0, h/2}); // goes down from the last position
alTrianglesOffset.add({-w, 0}); // goes left from the last position
alTrianglesOffset.add({0, -h/2}); // goes up from the last position
I'm trying to make this sketch build more dynamicaly, because it's supposed to be connected with external data, but i can't find a way to have something like
Here's my problem in the code below.
I want to know how often a word appears in the file (mousquetaires.txt : the text of les 3 mousquetaires, by Alexandre Dumas) but i want to exclude the useless words by adding a stopList (stopList.txt : a list of french words like "et", "de", "il" ).
I tried an "if" (line 37) structure but i can't make Processing match the words in the stopList and in the HashMap that contains each word in the text (mousquetaires.txt).
Please help me, i cant figure out where i made a mistake.
Excuse my english, i'm french.
Thanks
HashMap words; // HashMap object
String[] tokens; // Array of all words from input file