6
Topping the Charts
You are a record label company. Your goal is to get 4 of your signed bands in the top 4 positions in the charts. However, its recently been noted that bands currently in the charts influence who is going to be in the charts the next day.
In this challenge, each player will control 5 bands (instances of your code), each of them placed in alternating order in one of the 11 spots of the scoreboard, with the 11th spot open. Each band will have a unique, hidden ID (from 0-9), and a unique, visible name (a randomly generated integer).
Each turn, the band with the open spot below them in the charts will call an ID. The bot instance with that ID will move to that spot, creating a new open spot. If spot #1 is open, then the 11th bot will be the one to name an ID.
The game is over when spots 1-4 are all held by your bands, giving you 3 points. If a particular band ordering is created more than 3 times, then both labels will tie and be given 1 point. The player with the most points after facing each other player twice (to ensure both labels start with a band in the #1 position) wins.
I/O
Bots will be stay alive between turns. Information will be passed back and forth via STDIO. When multiple pieces of information is passed, it will be comma separated. Each instance of your bot MUST NOT communicate with each other (nor with the other team).
At the beginning of the game, your will be passed three integers, your ID, position, and name, and then you will be passed a list of names of the current positions, with 0 being the open position.
On your turn, you will be passed a list of names of the current positions, with 0 being the open position. You must return the ID you wish to place in the spot below you.
If you get switched, you will be be passed two integers, the name of the person that switched you, and your new position (from 0-10).
If you win, you will be passed 0, at which, you must end your program
The controller can be found here: https://github.com/nathanmerrill/ScoreboardKoTH
I should return an ID, but only know mine and the names of the other bands... That doesn't make sense to me, as I can't say
Move bot on position 3 to the empty spot
, since I don't know his ID. – CommonGuy – 2015-03-04T15:12:02.233@Manu You can figure out the IDs by trial. – Nathan Merrill – 2015-03-04T17:21:53.193
How? If I swap a band to the empty spot, I don't get notified which one moved. – CommonGuy – 2015-03-04T17:56:27.857
But every time you see the state of the chairs. On the turn after you moved somebody, you get to see who was different than last time. – Nathan Merrill – 2015-03-04T21:34:10.790