Background
The year is 2251. You are a self-evolving KOTH bot, in the mysterious land known as Programming Puzzles and Code Golf. To evolve, you need permissions, and to get permissions, you need reputation. You decide that the best way to do this is to take over all of the questions to gain as much reputation as possible. The only problem? Every other bot has decided to do the exact same thing.
Game Explanation
Each round is battled on a question, with 11 vote nodes, between you and your enemy. The board starts as this:
A1 A2 A3 N4 N5 N6 N7 N8 B9 B10 B11
A
is player A's nodes, B
is player B's nodes, and N
is a neutral node.
Each turn, you may:
- Vote on a vote node. If both players vote, nothing happens. If one side votes:
- and the node is controlled by no-one (neutral), it becomes that side's.
- and it is controlled by the voter's enemy, it becomes neutral.
- and it is controlled by the voter, nothing happens.
- Guard a vote node. This guards the node from votes (friendly or enemy) for 2 turns.
- Use your 'power'. The powers are listed below, including how to use them.
Your side wins if it controls at least 2/3rds (66%) of the vote nodes.
10000 rounds will be run, and the winner of the KOTH is whichever bot has the most wins (in the event of a tie, or indeterminate outcome, more matches are run until a clear winner is decided.)
How Your Bot Should Work
It should accept as command-line arguments:
B A1 A2 A3 N4 N5 N6 N7 N8 B9 B10 B11
Where A
denotes Player A's nodes, N
denotes a neutral node, B
denotes Player B's nodes, and the first argument (B
in this case) is the player your bot is. (This is decided randomly, your bot should work regardless.)
It should return one of the following (powers are general rules):
V-4
, vote on node 4
G-3
, guard node 3
P-N
, use power 'Neutralize'
with or without a trailing newline.
Powers
Intended to give bots a small boost. If X
was your power, you would use P-X
. You may only have one power per bot.
N
- Neutralize: Turn 2 random nodes to neutral ones.
R
- Rebellion: Pick a random node, and randomly turn it to a friendly, neutral, or hostile node.
S
- Swift Strikes: Pick two random nodes, and vote on them.
Here are the extra rules:
- The bots must fully run offline.
- The bots may not attempt to read any files, including their own source code.
- The bots may not tamper with, hack, or destroy other bots.
- The bots must return one of the three commands (
V
, G
, or P
). If they do not, they forfeit their turn.
- The bots must not be targeting other bots specifically. (Beating general strategies is welcome.)
- You may update your bot as often as you like, but bots that are updated very frequently with no good reason (i.e, fixing fatal errors is a good reason) will be disqualified.
- Your bot must take under 90 seconds for it's turn. If it takes longer, it will be disqualified.
Submission contents
Your submission must contain:
- The code for the bot
- The language it is written in (and a link to an offline interpreter, if necessary)
- Your bot's name (for the leaderboards)
- How to compile and run your bot
If you do not include all of the required items in your submission, you will be notified, but your bot may not compete until this is fixed.
Example Match
Matches are organized between 2 randomly-selected bots. Here is an example, with bots A
and B
:
The board begins as this:
A1 A2 A3 N4 N5 N6 N7 N8 B9 B10 B11
Bot A makes his move, voting on N4
, then Bot B votes on N5
:
A1 A2 A3 A4 B5 N6 N7 N8 B9 B10 B11
Node 4 becomes A4
, and it is now controlled by Bot A. Likewise, node 5 becomes B5
.
A
votes on N8
, and so does B
:
A1 A2 A3 A4 B5 N6 N7 N8 B9 B10 B11
Why did nothing happen? That's because both bots voted on the same node - cancelling out each other's effects.
When one bot controls 66% or greater of the nodes, that bot gains a win and the other bot gains a loss.
The game ends after 1024 turns, to prevent any bots that wait around forever. Whoever has the most nodes afterwards wins, or a draw if they have the same amount.
Additional Notes
- I will be submitting an example bot written in Python as part of my challenge. You are free to use and modify this bot for your submission.
- If your bot gives invalid output (not of the form
C-A
, where C
is the command and A
is the argument), the bot forfeits its turn. If it does, you will be notified, and your bot will be removed until it is fixed.
Meta Questions and Notes
- Are there any loopholes?
- Should I add/modify/delete some of the powers?
- Is something too simple/confusing/uninteresting/overpowered?
- Should bots be able to see which nodes are and are not guarded?
- Should I limit people to one bot? If not, I will prevent the same person's bots from battling each other.
- I have thought of the following alternative way to win matches:
- The game lasts 1024 turns. Whoever has the most nodes at the end wins.
- If, at one point, one bot controls all 11 nodes, that bot automatically wins.
- Would this be a better win condition?