The game is played on a 2D grid, made up of walls and empty cells.
Both players control a team of minions.
The game is played on turns. On each turn, both the player
should output a command that tells each minions
to move along the grid, collect coins,
capture opponent flag or
use power-ups to damage oppnent
minions.
The map
The grid is generated randomly, and can vary in height
and width. Each cell of the map is either:
- A wall (represented by a pound character: #)
- An empty cell (represented by a dot character: .)
Maps are always symmetrical across the central vertical axis.
Minions can move along the map only through empty
cells, they cannot pass through walls. The map is surrounded
by walls and hence, minions cannot go pass the border
of the map. Empty cells may contain coins.
height of the map (number of rows) will be in range
17 to 20 and
width of the map (number of columns) will be in range
33 to 35.
Minions
Each player starts with the same number of minions,
starting from 3 to a maximum of 5
minions per player.
Each minion starts with a health of
100 hp. Minions take damage
when a power-up is used against them and they lose
some hp, decreasing their health. A
minion whose health drops below
1 dies and is removed from the game. A dead
minion never returns back to the game.
Minions cannot see through walls. On each
turn, you have vision on all of the enemy minions
and coins that can be connected by a continuous
straight line to any one of your minions. That is,
a single minion can see everything along the
row and column it is in unless blocked by a wall. A player's vision is
the collected vision of all his/her minions.
The white minion's vision is indicated by
the arrows. It has vision on 2
opponent (red) minions.
Minions can receive the following commands (a
minion can receive only one command per turn):
-
MOVE: Give the minion a
target position. The minion will find a shortest route to
that position and move to the first empty cell along that route.
The minion will not take into account the presence of any other
minions or coins when choosing
the route.
-
WAIT: Do nothing.
-
FIRE: The minion uses the
power-up fire. Refer to
power-up section.
-
FREEZE: The minion uses the
power-up freeze. Refer to
power-up section.
-
MINE: The minion uses the
power-up mine. Refer to
power-up section.
Note that, minions never collide and multiple
minions can exist in the same cell.
Flag and Flag Base
Each player's flag resides at their respective
flag-base in the beginning of the game. A player's
minions can only carry opponent's
flag. Note that, each player's
minions cannot carry their own flag
A flag can be carried by only one
minion at a time. Once a minion
obtains a flag , it cannot drop the flag until it is dead.
Following the flag carrying minion's
death, the flag remains at that cell where the
minion died until some other minion
picks it up.
Power Ups
There are 3 types of power-ups that
a minion can use:
Note that, all the power-ups have friendly fire on. That
is, each of the power-ups affect opponent and
teammate minions equally. Only the
minion that uses FIRE or
FREEZE is unaffected by that action. Also note that,
MINE affects every minions, including
the one who planted the bomb.
Coins
At the start of the game, all the empty cells contain a
coin. Each coin is worth
1 score point. A
minion can collect a coin if
it walks over a cell that contains a coin. Once
a coin has been collected, it disappears and
never reappears. A player starts with 0 score points
Victory Conditions
-
Your minion has returned to your base
with the opponent's flag before opponent took your
flag to their base
-
All opponent minions are killed.
-
If both the flags were captured at the
same time, then you have more alive
minions than your opponent
-
If both the flags were captured at the
same time and you have same number of alive
minions as your opponent, then you
have higher score than your opponent
-
You have more alive minions
after 200 turns
-
In case of having same number of alive minions
as your opponent after 200
turns, you have higher
score.
In case of tie, the game is considered as a draw, with both player being 1st
Defeat Conditions
-
Opponent minion took your flag to
their flag-base before your
minion captured opponent
flag.
-
All your minions die.
-
Your program does not provide a valid command in time.
🐞 Debugging tips
- Hover over an entity to see extra information about it
- Press the gear icon on the viewer to access extra display options
- Use the keyboard to control the action: space to play/pause, arrows to step 1 frame at a time
- For printing out anything, use stderror
Action order for one turn
-
Wait for both players to output commands
-
Any frozen minions are unfrozen
-
Flag positions are updated
-
Minions are moved
-
Coin positions are updated e.g a coin
is removed if it has been taken by a minion
-
Apply power ups and damage to corresponding
minions
-
Check and detonate mines
-
Remove dead minions
-
Decrease minion freeze
timeout
Game Input
Initialization Input
Line 1:
two integers height and width - the size of the maze.
Next height lines:
a string of width characters each representing one cell of a row:
'.' is an empty cell and
'#' is a wall.
Next line:
two integers:
myFlagBaseR and
myFlagBaseC -
the row and column respectively of the cell indicating the
flag-base position of the player.
Next line:
two integers:
opponentFlagBaseR and
opponentFlagBaseC -
the row and column respectively of the cell indicating the
flag-base position of the opponent.
Next 3 lines:
powerUpName ,
powerUpPrice and
powerUpDamage
Input for Each Game Turn
Line 1:
two integers:
myScore and
opponentScore
- player's and opponent's current score respectively
Line 2:
three integers:
myFlagPosR,
myFlagPosC and
myFlagCarrier -
player's flag position
(row and column respectively) and
id of opponent minion who is carrying player's
flag
(-1 if no minionis carrying)
Line 3:
three integers:
opponentFlagPosR,
opponentFlagPosC and
opponentFlagCarrier -
opponent's flag position
(row and column respectively) and
id of player's minion who is carrying opponent's
flag
(-1 if no minionis carrying)
Line 4:
myAliveMinionCnt - number of player's alive minions
Next myAliveMinionCnt lines:
id,
posR,
posC,
health,
timeout -
player's minion's id, position (row and column), health and timeout
Next Line:
visibleMinionCnt - number of opponent's visible minions
Next visibleMinionCnt lines:
id,
posR,
posC,
health,
timeout -
opponent's minion's id, position (row and column), health and timeout
Next Line:
visibleCoin_cnt - number of coins visible by player's minions
Next visibleCoinCnt lines:
posR, posC coin position (row and column)
Output for One Game Turn
A single line with one or multiple commands separated by
|.
For example:
MOVE 0 5 7 | MOVE 1 16 10.
-
MOVE minionID x y: the minion with the identifier
minionID moves towards the given cell following the shortest path.
-
FIRE minionID: the minion with the identifier minionID
uses FIRE.
-
FREEZE minionID: the minion with the identifier minionID
uses FREEZE.
-
MINE minionID r c: the minion with the identifier minionID
plants a mine at the cell (r, c)
i.e at row r and column c.
-
WAIT minionID: the minion with the identifier minionID
does nothing.
You must provide a valid command for atleast one
minion each turn, even if all of your
minions
are currently
frozen and timed out.
Constraints
17 ≤
height ≤
20
33 ≤
width ≤
35
3 ≤ Initial
minion count ≤
5
Initial score points for each player =
0
Response time per turn ≤
50ms
Response time for the first turn ≤
1000ms