This would work like the PVector
class that would be included in the core jar.
But I do understand that it can cause compatibility issues.
The only reason that I wanted to allow users to use the FriendlyWords
class directly is because it seemed wasteful to include it in the app and not allow access. (I mean the data is sitting right there.)
If the user HAS to download a library anyway, then it might be easier to get it directly from the text files provided by Glitch.
It is trivial to read the txt file and split by newline.
This sounds like a great idea. loadStrings()
has automatic line splitting built in.
String[] predicates = loadStrings("https://raw.githubusercontent.com/glitchdotcom/friendly-words/master/words/predicates.txt");
String[] objects = loadStrings("https://raw.githubusercontent.com/glitchdotcom/friendly-words/master/words/objects.txt");
for(int i=0; i<5; i++) {
int p = (int)random(predicates.length);
int o = (int)random(objects.length);
println(predicates[p], objects[o]);
}
insidious smell
seasoned animal
possible custard
bittersweet wound
inconclusive creator
1 Like