Instructions

Post Reply
User avatar
gorzak
Posts: 18
Joined: Fri May 18, 2007 2:25 pm

Instructions

Post 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.
Captain Segfault
Posts: 67
Joined: Sat May 05, 2007 6:11 pm
Location: San Carlos, CA
Contact:

Post 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.
User avatar
adum
Posts: 392
Joined: Thu Apr 19, 2007 12:49 pm
Contact:

Post 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
Post Reply