automatically fill a coll with the right syntax from a message or text file ?
I'm making an 'indian name generator' randomly choosing from three lists (adj1, name, adj2) and I'm looking for a way of filling the three 'coll' objects I use to pick the random elements from, but without having to type '1, sequoia; 2, ...;). So I thought maybe this could be possible from a text file or message because my lists are about 300 words each for now. Any smart solution ?
This doesn't sound too hard. Post an example file.
Like this?
To Chris : ok, so now I've got this which seems smart to me (I'm a max beginner) EXCEPT that the first element of the text file is indexed as the last in the 'coll'. Don't understand why for now...
I add a new text file as my patch works (I imagine so but maybe I'm wrong) because each word is a on a different line. Is there a way to do the same with just spaces between words in the list ?
btw, just noticed your name in the uzi help file, so I guess you're the one to help me :-)
Just used your second text file with it and get this in my coll:
0, Obus;
1, Opossum;
2, Ovidé;
3, Ovipare;
4, Pamphlet;
5, Panorama;
6, Paradoxe;
7, Parasite;
8, Parfum;
9, Passe-temps;
10, Pastiche;
11, Pélerin;
12, Pensif;
13, Pensum;
14, Pépin;
15, Périmètre;
16, Perroquet;
17, Persifleur;
18, Pervers;
19, Pétoncle;
And here's one that works with the names with just spaces between as in your first post:
Sorry Luke, your patch works, it's just that I had built mine besides sharing the same coll argument, hence the strange results I got as the two contents got mixed up. Now I've got your solution and mine, are there practical differences between the two ?
Well, the top part of your patch is redundant really, have a look here:
A tiny improvement to Luke's solution:
Haha, always room for improvement! :)