Re: Contest 2

new topic     » goto parent     » topic index » view thread      » older message » newer message

On 19 Nov 2004 16:57:08 +0100, Christian Cuvier
<christian.cuvier at agriculture.gouv.fr> wrote:
> Is the "arena" argument passed to get_orders() a two level or one level
> sequence? Could be any of them from the way rules are written.
 
Thank you, I've fixed that up:
"The arena is composed of a 2-dimensional array with dimensions arena[
metrics[WIDTH] ][ metrics[HEIGHT] ].
A unit at the cartesian coordinate {5,7} can be found at arena[5][7]."

> Also: are there any provisions to change the routine_id for get_orders()
> during a match? This may be cleaner if some different tactics are used when=
> many or not many walls around, many or not many ene=F9my units, etc etc. Of=
> course, you may consider that there's only a static get_orders() and the
> choices are to be made inside the competing program only.

Uh, not really... 
I understand what you're getting at though, and I think the best thing
would be to have a persistant state variable, and a big if statement
first thing in the get_orders() routine to decide what to do. The
performance hit is negligible, as the get_orders() routine is only
called once per turn, not per unit.

You are allowed to declare things at top-level like persistent data
structures, state variables, etc... you just have to initialise them
within the startup routine. This is because sometimes the program will
be executed without ever calling user code. (Look in the .ew file - if
it's called with 'about' as an argument, it'll send the name and
description to the GUI, then quit)

-- 
MrTrick

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu