I had a feeling this might be impossible. But seeing as every idea I try out recently on my current project I'm too stupid to realise I tried to think of a new idea.
I thought of how I seemed to grasp automata well and wouldn't it be cool if people could come visit me with their own automata and release them on a giant virtual canvas. I thought I might have to write a script language for this though. Then I thought, "hang on, I can just use the magic -include- command in php to drag in any old jibberish wherever I want, can't I do that in Processing?" I then thought that if each new automata was an object file that object file could be pulled in using a hub file that would run all the objects. There would be no need for a script language, people could write the automata in Processing syntax!
But I would need some kind of self adapting code in order to pull in the new objects. I can't seem to use the "import" command, I don't know how it works. I noticed that when Processing compiles tabs it just pads them on the end of the .java file. That gave me an idea. I thought that it should be possible to write a self adapting application from the API:
Code:
String [] thisCode;
int i = 0;
void setup(){
thisCode = loadStrings("../adapt.pde");
String [] selfWrite = subset(thisCode,thisCode.length-4,3);
thisCode = splice(thisCode,selfWrite,thisCode.length-1);
saveStrings("adapt.pde",thisCode);
}
void draw(){
while ((++i)<thisCode.length){
println(thisCode[i]);
}
}
So can I do this from an applet? Does the applet use the .java file or is it simply there for show?
I'd very interested to hear of any alternative solutions, maybe a php hack or something. Thanks in advance.