Contest #2 Spazbot Question

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

Is the following a valid bot program?

include eubots.ew
-------------------------------------------------------------------------------
--SpazBot
--Author: c.k.lester
--Date:   2004.11.22
--Version: 1.0
--Comments:
--	This is a simple moving bot. It moves randomly. Good luck catching it.
--
-------------------------------------------------------------------------------
entrant_name = "SpazBot"
entrant_desc = "This AI does nothing but run around.\n"&
               "Good for moving-target practice."
-------------------------------------------------------------------------------
without warning
-------------------------------------------------------------------------------
-- must I do the following?
function get_my_pos(sequence a, sequence me)
sequence pos
	pos = {}
	for H=1 to length(a) do -- HEIGHT
		for W=1 to length(a[x]) do -- WIDTH
			if a[W][H] = me then
				pos = {W,H}
			end if
		end for
	end for
	return pos
end function
-------------------------------------------------------------------------------
--start procedure
procedure start() 
end procedure
-------------------------------------------------------------------------------
--get_orders function
function get_orders(sequence arena, sequence metrics)
    return {get_my_pos(arena,metrics[IDENTITY]),MOVE,rand(8)}
end function
-------------------------------------------------------------------------------
--cleanup procedure
procedure cleanup() 
end procedure
-------------------------------------------------------------------------------
eubot_init(routine_id("start"), routine_id("get_orders"), routine_id("cleanup")
)


-=ck
"Programming in a state of EUPHORIA."
http://www.cklester.com/euphoria/

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

Search



Quick Links

User menu

Not signed in.

Misc Menu