Difference between revisions of "Talk:Code Size"

From Robowiki
Jump to navigation Jump to search
(Code Help Please!)
Line 3: Line 3:
  
 
All you need to do to run the code size utility is "java -jar /path/to/it/codesize.jar /path/to/my/class.class". If you still can't get that working or just find it easier, you can use the "Package robot for upload" feature of Robocode which will tell you what the codesize is. Note, it's impossible for a javascript to easily detect the codesize of pastes java source code, because it's measured from the compiled bytecode not the source. --[[User:Rednaxela|Rednaxela]] 21:16, 13 March 2009 (UTC)
 
All you need to do to run the code size utility is "java -jar /path/to/it/codesize.jar /path/to/my/class.class". If you still can't get that working or just find it easier, you can use the "Package robot for upload" feature of Robocode which will tell you what the codesize is. Note, it's impossible for a javascript to easily detect the codesize of pastes java source code, because it's measured from the compiled bytecode not the source. --[[User:Rednaxela|Rednaxela]] 21:16, 13 March 2009 (UTC)
 +
 +
== Reducing Code Size ==
 +
 +
Well, I have a strong nano but it's roughly 280 in code size.  I know I can shrink it...  I'm just not very good at it.  This method takes like twenty codesize points, (that's what I'll call them) and I SERIOUSLY need to shrink it.  Any help please?
 +
 +
Code:
 +
<pre>
 +
public void alternate() {
 +
i();
 +
if (alternate) {
 +
alternate = false;
 +
i();
 +
return;
 +
}
 +
alternate = true;
 +
}
 +
</pre>
 +
At least I TRIED to shrink it!
 +
 +
 +
lolz,
 +
:--[[User:Awesomeness|Awesomeness]] 01:22, 18 March 2009 (UTC)

Revision as of 03:22, 18 March 2009

Codesize for some reason doesn't work for me. Can someone make a GUI version of it? It isn't too hard with Swing. (I've made a compression program with an algorithm of my own invention with a Swing GUI.) Or could someone post a javascript that detects it (the size) after you paste code in? Thanks! --Awesomeness 21:05, 13 March 2009 (UTC)

All you need to do to run the code size utility is "java -jar /path/to/it/codesize.jar /path/to/my/class.class". If you still can't get that working or just find it easier, you can use the "Package robot for upload" feature of Robocode which will tell you what the codesize is. Note, it's impossible for a javascript to easily detect the codesize of pastes java source code, because it's measured from the compiled bytecode not the source. --Rednaxela 21:16, 13 March 2009 (UTC)

Reducing Code Size

Well, I have a strong nano but it's roughly 280 in code size. I know I can shrink it... I'm just not very good at it. This method takes like twenty codesize points, (that's what I'll call them) and I SERIOUSLY need to shrink it. Any help please?

Code:

	public void alternate() {
		i();
		if (alternate) {
			alternate = false;
			i();
			return;
		}
			alternate = true;
	}

At least I TRIED to shrink it!


lolz,

--Awesomeness 01:22, 18 March 2009 (UTC)