Program your robots to deliver packages in a warehouse infested with destroyer drones. Avoid the drones and get your packages to the right place as fast as you can.
Delivery Robots
- There are packages labeled a-z in a warehouse.
- Packages must be delivered to a matching chute A-Z.
- A robot cannot move to a square that contains a wall or another robot.
- A robot passing over a package will pick it up if it is not holding a package.
- A robot landing on a chute will drop their package if the package label matches the chute.
Destroyer Drones
- Drones each start with a random heading.
- If there is a clear line of sight to robots (NSEW), the drone will move toward the closest visible robot.
- If in a dead end or blocked by another drone, the drone will reverse direction.
- If at an intersection, a drone will choose a random direction (but not backtrack).
- Otherwise, a drone will move on its current heading.
- If a robot is ever in one of the four adjacent squares next to a destroyer drone, that robot is destroyed and disappears. If the robot had a package, it is dropped, replacing any package or chute already there.
- Drones pass over packages.
Warehouse Arena
#################################################
#B # # # ff #
############ ##### ######### # # # # ########## #
##### ### efg* ## # # # C# #
# # ## ############ ############ #
# ###### ## ## ########## ##### #
# de # ## ## ################## ##### ## # ## #
###### # ## ## # ### ### ## # ## #
# # ######## ########### ######### ## # # #
# ###### # A # ## ## # #
# ## ###### #### ## ####### ########### # aeb # #
# ##G ### ## # ## ####### #
# ## ###### ### ### ####### ## ######## #
# ######### ### ### * ## # #########
# cfe ## ### ####### ###### ######## ## #
######## ## ### ### ###### #### #
######## ## ### ### ### ############### ####### #
# ### ### # # # # # #D# # #$$$$ #
# ###### ########## ##### # #
# ###### #### ##### ### ############### ### ## #
# # ## ### ##gba ### #
# ## ### #### ## ## ### ############### ### #####
# ## ### # * ### # #
# ###### ############## ############### ####### #
# ########## ## E ## # #
############ ###abc ## ### ### ## ####### # #
# ##### ####### ### ## # #
# # ######## ##### ####### ### ###### ######### #
# F # # # ccc #
#################################################
#: wall, $: delivery robot, *: destroyer drone, a-z: package, A-Z: delivery chute
Game Flow
Your program will be called with an arena file argument and MAXTURN integer. The program should follow the logic flow below.
read in arena
for turn in 1..MAXTURN
for each robot
optionally move robot to one of four adjacent squares
if chute here and has matching package
remove package from robot
add to score
if all packages delivered
add turns bonus
end game
if next to drone
delete robot
reduce score
if package here and robot has no package
add package to robot
remove package from square
for each drone
decide heading using specified rules
move drone
if next to any robots
kill those robots
drop packages onto map
if no robots left
end game
Output
Your program will output your score for that game.
Scoring
- The test arena with MAXTURN=5000 will be used for scoring.
- You score 500 points for each package delivered.
- You lose 900 points for each robot destroyed.
- The game ends if all robots are destroyed or MAXTURN turns elapse.
- If you deliver all packages, you gain a bonus point for each turn you had remaining.
Your total score will be the sum of the scores of 3 consecutive games.
Your program must not assume this test arena. An arena my be up to 200x200 squares and contain thousands of packages, chutes, robots, and droids. If I suspect any submission to be tailored towards this specific arena, I reserve the right to replace it by a new arena. Standard loopholes are prohibited as usual.