Third programming contest – Teams

Switching teams

How do you switch the team? There are three ways. At the start of the game in the blue team you have a life energy of 100.0 points. If it falls down to 0.0 (or below) you will automatically join the red team. This leads to the next question: How can the life energy decrease? The reason is the green mist mentioned above. It is toxic and so walking through the halls will lead to a loss of some energy. There is no field on the map that does not have any toxic value. Even worse: If you stay several rounds in one place the toxic value will be multiplicated with the number of rounds you're staying on this field.

The second way to change to the red team is after been catched by a red team member. You will be “infected” and must now catch your former blue comrades. So, you've hidden long enough, now you need to catch them if you can. You will earn some points for every blue team member you catch (see below).

Catching is only possible if the two players stand on two adjacent fields. For example:


Who catches whom?

Player 4 and 5 are in the read team, the other eight players are in the blue team. In the above image player 5 catches player 3, but he does not catch player 2 because the way is blocked by 3. Player 4 catches player 8, but he does not catch player 1. The way to 1 is blocked by two walls. Player 4 does also catch player 9 even if there is a wall on a neighboring field (above of 4). But he could easily walk or grab around the wall (left of 4).

Now it is time to ask the most important question: If everyone starts in the blue team, how does someone join team red (without loosing all the life energy of course)? Easy answer: After some rounds (see below for the exact number) a blue team member will be chosen to join the red team. The player will be selected depending on the life energy you currently have. So the player with the lowest value has to change the team.

So what is the exact number of rounds before a player must switch the team? This depends on the current round and the number of rounds since the last team change. If no-one has switched the team the last

25 + current round / 10.0

rounds, the team change will be forced. This means that during the first 28 rounds of the game there will not be any team change. This should be enough time to find a nice place on the map to hide. The current round is part of the formula because the longer the game is running the less should the game mechanics influence the game play.

For all the mathematicians and everyone who wants to know: You can calculate exactly in which round the next team change will be forced. Assumed the current round is M. Then the next forced team change will be in round

10.0 / 9.0 * ( 25 + M )

A few examples:

  1. At the beginning of the game (round 0) the first team change will be in round 10/9*(25+0) <= 28.
  2. The next team change after this will be in round 10/9*(25+28) <= 59.
  3. The next rounds are 94, 133, 176, 224 etc.

This also means that you can calculate how long the whole game will last if all blue players will be forced to change the team (and no-one is catched in this time). If you are in round R and the last team change was S rounds ago, the next team change will be (with above formula) in round

10.0 / 9.0 * (25+R-S),

or better in

10.0 / 9.0*(25+R-S)-R

rounds. You can iterate over all remaining blue players and will get the number of rounds the game could take.

There is only one exception of the rule: If there is only one player left in the blue team no team change is forced anymore. This last blue player can move freely as long as he wants; or better as long as he is not catched or his life energy is not at zero level. This exception is not part of the above formula when calculating the last round of the game.

previous page next page