Thanks, PhiLho -
To answer your last question first:
My goal is eventually take two of the elegy by John Donne, Elegy 8, and compare them, because though they are the same poem, they were copied by different scribes, and so each has slight differences in wording here and there throughout the copies.
I wanted to create a program that could load the poems, and then visually display the differences (and also, by default, the similarities) in some mildly artful way.
There are 48 copies of the same poem, and so I was hoping to build a framework that would be flexible enough so that eventually I could keep working on the program, refining it, so that an end user could choose which of the 48 to compare (or perhaps compare all at once, again, with some visual indicator of major differences).
As this is part of a larger study being done by a friend, the Donne poems are already supplied in a textual format, that with a little bit of effort, can be loaded straight into Processing.
My programming outline went something like this:
Load the text.
Create and assign each poem to an array.
Create and assign each word in the poem to an array.
Create and assign each letter in the poem to an array.
Convert each word into a number using ASCII (because it's a standard, rather than creating some numerical system of my own)
Convert an array to store not only the ASCII value of the word but where it occurs in the poem (in the case of duplicated ASCII numbers).
Then, using these numbers, create a variety of simple visualizations. Maybe print the poem to the stage (what I was working on at this point), and then having each successive iteration of the poem change the alpha of the words that are the same, only leaving fully visible the words that are different.
And so on. I figured once I had the words converted to numbers and in an array, I would really worry about the visualization part later, because I have more experience making fun simple cellular automata, like the bog standard Game Of Life, but it helped me learn how to create some nice color changes based on 2 or 3 value array data (I avoid the use of 2D and 3D because I don't yet know how to work with 3D).
In order to accomplish this set of goals, which seems very large to me, I wanted to get to where I could simply gather one word from a text file and display it to the screen. And so far, as you've noticed, I'm not doing very well.
I understand what you mean, I believe.
In the central loop, the variable 'words' is used in "String[] words = split(lines[e], ' ');
That's where you mean that I reused the variable 'words', right?
So, I need a new variable to store my data from the loaded text, which in this case is a string, and again, in this case, the word, 'come'.
When I tried creating, say, a new variable named elegyWord;
as a global variable:
char elegyWord;
But then, in your reply you wrote that 'char' can only declare a variable that can store a single character, am I understand you correctly? At any rate, when I tried to then assign my 'words' variable to the new variable 'elegyWord', I got the perhaps expected error, '
cannot convert from string to char' which makes sense, given what you've told me.
So, does that mean I should declare a new global array to hold the information from the words array?
And if so, how do I assign the new array to the words array? I'm going to give it a go, and if I fail, I'll be back. One day, I hope to be back with some pretty and interesting to share with you, rather than simply my beginner's mistakes.
If you want to see a fun program I wrote in ActionScript a long long time ago now, please visit:
http://www.scotrick.com/03_flash/01_aMazeOffBounce.htmlThis one lets you move white lines found on the right hand side of the screen, lay them on the 'play area, and then create a miniature musical composition as a moving line 'bounces' off the line. For an interesting screw up in the way I programmed the hit detection, you can place one line on top of another, creating a 'chord'.
or simply www.scotrick.com and the choose the 'flash' section to see others.
***
But in the meantime, I dream of getting this one word out of this .txt file and onto the screen.
Thanks again for your patience in dealing with such a beginner at Processing.
Scotrick