)as strings and put each line from the .txt into a seperate array?
Another problem for me will be how to convert the hexcode which is then treated as string to a color.
THX alot to everbody helping me!
(later i want to replace Car and Blue in the line: "stimulus Car = new stimulus ("Car" ,Blue );" with the data from the txt file ...)
stimulus[] stimuli;
void setup() {
size (1024,768);
smooth();
// Load text file as an array of String
String[] data = loadStrings("data.txt");
stimuli = new stimulus[data.length];
//each line from the data is converted into and array
for (int i = 0; i < stimuli.length; i++){
String[] values = String(split(data[i],","));
stimuli[i] = new stimulus(values[0],values[1],values[2]);
}
}
void draw(){
background(0);
stimulus Car = new stimulus ("Car" ,Blue );
Car.display();
}
// Define Class Stimulus
class stimulus {
String condition;
String word;
color kleur;