Challenge for AI Gurus!
Hi there!
Assume you have a 2d array with dimensions (n,m) and one or more objects with a position (x,y) and a direction (dx,dy) which is always one of the following: (1,0), (-1,0), (0,1) or (0,-1). The array is initialized with 0 and all objects are alive (object.dead = false).
Now imagine there's a loop that always does the following:
The goal of each object is to stay alive as long as possible. What would be your approach for the object.compute_direction() function?
- flix
PS: sorry, I don't know how to post beautiful code here... =(
|