Page 1 of 1

Instructions

Posted: Wed Mar 05, 2008 2:12 am
by gorzak
I am teaching myself java programming with the sole purpose of playing the game.

With that said, I don't understand what counts as an instruction, and what does't.

Starting out, I had very low instruction levels. Since I was modeling them off the practice bots with a few tweaks, they didn't seem to generate many instructions. I actually changed quite a bit, and still kept it close to zero with a score of bots.

I added a lot of stuff since then though, and now each bot takes around 500 instructions!

I need help! I don't even know how it got so high! It doesn't seem like I did that much more typing.

Posted: Wed Mar 05, 2008 5:26 am
by Captain Segfault
It's java bytecode instructions; each time an instruction executes the count goes up by one. You can use javap to disassemble your bytecode to see exactly what the instructions are.

A line of code might be several instructions-- 500 doesn't actually correspond to /that/ much executed code, particularly if you have any function calls or loop over arrays or the like.

Posted: Wed Mar 05, 2008 6:49 am
by adum
as segfault noted, 500 isn't very much. the sample bots are so simple that they hardly use anything, but more complicated bots will use a lot more instructions. since you have 100,000 per tick, you're far from hitting a problem.

adum