|
Author |
Topic: compare input data to external file and output (Read 908 times) |
|
kateto
|
compare input data to external file and output
« on: Mar 26th, 2005, 6:39pm » |
|
Hi all! I was wondering, how exactly can I do the following: 1)The user inputs a string of letters [convert uppercase to lowercase]. As soon as the 'enter' key is pressed, all the letters are assumed to be a word. 2)This word is then compared to a dictionary [a .txt file in the data folder] 3)If the word is encountered, it appears on the applet, else each letter is replaced by a circle. ------------------------------------------------------ This is my starting point: BFont f; void setup(){ size(600,400); f = loadFont("Futura-Medium.vlw.gz"); textFont(f,20); String word = "hot"; String myArray[] = loadStrings("data.txt"); for (int i=0; i < myArray.length; i++) { if (myArray[i].equals(word)) { println("hot"); text(myArray[i],10,20); } } } ------------------------------------------------------ Anyone? Thanx in advance!!!
|
|
|
|
kateto
|
Re: compare input data to external file and output
« Reply #2 on: Mar 27th, 2005, 5:29am » |
|
on Mar 26th, 2005, 7:34pm, st33d wrote: ------------------------------------------- Thanx!!!
|
|
|
|
|