You are stranded on a deserted island with some servants and are hunting for treasure. The longer one searches, the more treasure one finds. The fewer people searching, the more each person finds.
Due to limited supplies, the leader has decided that a few people, up to a quarter of the group, shall be left to die each night. He has decided not to tell anyone exactly how many people shall die on any given day ahead of time.
You are in control of a small group of 5 people, who shall venture out of camp to find treasure for you.
The objective of this competition is to amass as much treasure as possible. Every turn that your servants do not attempt to return to camp, they will find a certain number of pieces of treasure. Your servants may return to camp at different times.
Each turn that a worker stays out to search for treasure, the worker finds
1+R pieces of treasure, where
R is the number of workers (out of all the bots) already back in camp. Dead bots do not factor into this calculation.
At the start of each day, a random number (
max(3, floor(num_live_players/4)) will be chosen. (For 10 players on day 1, this is
max(3,50/4)=12. For 20 players on day 1, this would be
max(3,100/4)=25.) This number represents the number of players who will be left to die for that day, and will not be given to your program.
If a servant is one of the last
n people to return, he/she will die and be unable to transfer the treasure he/she found to your possession. Furthermore, the servant will be unable to participate in treasure hunting for the rest of the adventure.
Your final score is the average amount of treasure you obtained per adventure (run of the controller).
If more people attempt to return to camp on the same turn than there are open slots, random numbers will determine who gets in and who dies.
A day on this island from sunrise to sunset lasts 30 turns. As there are many dangerous animals at night, failure to return by sunset means that you will not be allowed into the camp.
Your program should run for the entirety of the simulation.
At the start of the simulation,
INDEX I will be inputted, where
I is the index of your bot (this index is counted from 1 up).
At the start of each day,
START_DAY D/N will be inputted to your program, where
D is the day number (starting from
N is equal to
max(3, floor(num_live_players/4)), which is the maximum number of people who may die on that particular day.
At the start of each turn,
START_TURN T will be inputted to your program, where
T is the turn number (starting from
Once your program receives this, it should respond with a list of your servants' moves, each separated by a comma.
Valid moves are:
R: Try to return to camp.
S: Stay looking for treasure.
N: Servant is already dead or in camp.
Entering an invalid move will be interpretted as
S if the bot is alive and not in camp, and
At the end of each turn, a string shall be passed to your program:
END_TURN [Turn #] [Bot 1 Moves] [Bot 2 Moves] ...
where each bot's servants' moves are separated by commas.
These moves will be one of the following:
R: Successfully returned to camp that turn.
r: Failed to return to camp that turn.
S: Still looking for treasure.
D: Died on an earlier turn.
N: Already back at camp.
Bots and servants remain in the same order throughout the entire simulation.
INDEX 2 .... END_TURN 8 N,N,N,N,N r,r,r,r,D D,D,D,N,R S,D,D,N,D
Here, you are the second bot (
r,r,r,r,r), who tried to return all four servants that are still alive (and unluckily failed on all four). Bot 1's servants are all back in camp. Bot 3 has three dead servants, one more back in camp, and a fifth servant who successfully returned. Bot 4 has one servant who stayed (and will die, as this is the last turn of a day), one servant in camp, and three dead servants.
After each of these strings, unless a string signaling the end of the day has also been outputted (see below), your program is to output your servants' next moves, separated by commas. All servants must be accounted for (with
N if already in camp, and
D if already dead). Invalid moves will be treated as
S if the servant is not already in camp/dead.
Servant # | Action 1 | Do nothing. 2 | Do nothing. 3 | Stay put (keep looking for treasure). 4 | Stay put (keep looking for treasure). 5 | Try to return to camp.
At the end of a day, the following string shall be passed after the last turn's
END string, informing everyone on who is alive:
END_DAY [Day #] [Bot 1 Status] [Bot 2 Status]
where the status is a comma separated list of either
A (alive) or
D (dead). The following day begins immediately after.
The simulation ends when there are fewer than 6 live servants. Your program will receive the following input at the end of the simulation:
- Only on turns where your action is
Swill you find treasure.
- Number of simulations run: 1000 times
- Your program should not take any more than 1 second to determine moves.
- Your program should not exit early; it will be started exactly once.
- Make sure that the output buffer (if applicable) is flushed after each output.
- Files may be written to in your bot's folder (
./players/BotName/). Your bot name is whatever you name your bot, with all non-alphanumeric characters removed and written in CamelCase. Entries may save data between runs of the controller, as runs are done sequentially.
- Your program must exit after receiving
- Programs that fail to compile or throw errors or output invalid text (not in the format of 5 characters separated by commas) may be excluded from the competition. A newline must follow each output.
- The controller may be found on GitHub.
Please include the bot name, language+version, code, and command to compile (if applicable) and run your bot.
Text outputted by the program is prefixed here with a
>. Your program should not output this character.
INDEX 2 START_DAY 1/3 START_TURN 1 >S,S,S,S,S END_TURN 1 S,R,S,S,S S,S,S,S,S START_TURN 2 >S,S,S,S,S END_TURN 2 S,N,S,R,S S,S,S,S,S START_TURN 3 >R,R,S,S,S END_TURN 3 R,N,R,N,R R,R,S,S,S START_TURN 4 >N,N,S,S,S END_TURN 4 N,N,N,N,N N,N,S,S,S START_TURN 5 >N,N,R,R,R END_TURN 5 N,N,N,N,N N,N,r,r,R END_DAY 1 A,A,A,A,A A,A,D,D,A START_DAY 2/3 START_TURN 1 >S,S,N,S,N END_TURN 1 R,R,R,R,R S,S,D,D,N END_DAY 2 A,A,A,A,A D,D,D,D,D EXIT
The scores for the above example are:
Bot# Day 1 Day 2 Total 1 10 0 10 S1 1+2 0 3 S2 0 0 0 S3 1+2 0 3 S4 1 0 1 S5 1+2 0 3 2 20 0 20 S1 1+2 0 3 S2 1+2 0 3 S3 0 0 0 S4 0 0 0 S5 1+2+3+8 0 14
The winner is therefore the player, bot 2. Note that the winner does not have to survive to the absolute end. (Also note that the player could have remained until turn 30 on day 1, since the camp would not be full until the player sent one more bot back).
Bot Score Bob 2939.422 Statisticians 2905.833 Morning Birds 1652.325 Evolved 1578.285 Slow Returners 1224.318 Wandering Fools 1065.908 Randomizers 735.313 Drunkards 0 Plague 0