General Discussion > Computer Programming

Creating .8xp programs (Axe) in Java

<< < (2/3) > >>

shmibs:
perl is really easy to get into, and the benefits of easy string manipulation and extensive regex support would be helpful in a tokenizer to the extent of making it probably more worth your time to learn how to use it and then write the program rather than trying to use java :P

cooliojazz:
would you like the back end from tfe? i already kind of have it almost in a library form (since i was planning on making it a library eventually anyway)

pimathbrainiac:

--- Quote from: cooliojazz on March 27, 2013, 11:35:02 am ---would you like the back end from tfe? i already kind of have it almost in a library form (since i was planning on making it a library eventually anyway)

--- End quote ---

Yes please! Is that C/C++, or Java?

cooliojazz:
Java. Here is the com.up.ti package. This is the source, so if you can't figure out how to directly use, you can maybe just extract the read/write routines. Or if you need more help using this just ask.  Note: There is the PictureFile class in there, and also a Real class, they arent actually needed for the program stuff, but theres some references that would break if i took them out, so i left them :P (actually, there are quite a few excess classes that are there for multiple file-type stuff. if they really bug you, i can give you a version without them)

To read a file:

--- Code: ---ProgramFile pf = new ProgramFile();
pf.openFile("Cool File.8xp");
pf.Tokens //String-ization of all the tokens
pf.Name //Program name
//To get a short[] of all the bytes of the program:
pf.ts.stringToData(pf.Tokens);
//To load a custom token set (see the file syntax in the main tfe thread)
short[] temp = pf.ts.stringToData(pf.Tokens);
pf.ts.changeTokens("Custom Tokens.tokens");
pf.Tokens = pf.ts.dataToString(temp);
//Or easier
pf = new ProgramFile();
pf.ts.changeTokens("Custom Tokens.tokens");
pf.openFile("Cool File.8xp");

--- End code ---

So have fun!

Also: Credit would be appreciated :P

pimathbrainiac:
Thank you so much!

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version