Program your robot to compete with other players and cover the virtual playing field in your color of paint.
- Bots paint any cell they occupy in their own color
- When the game starts, bots paint their starting cell in their own color.
- On each turn, all bots move at the same time.
- Bots can move up, down, left, or right.
- Bots can skip a turn instead of moving.
- Bots cannot move into a cell occupied by another bot.
- If multiple bots try to move into the same cell, they will all stay on their original cells.
- Bots start the game facing in the up direction.
- Bots face the direction of their last move.
Calling any of these methods uses a turn.
- Moves the bot up (towards y = 0), if possible
- Makes the bot face in the
'up'
direction
- Moves the bot down (away from y = 0), if possible
- Makes the bot face in the
'down'
direction
- Moves the bot left (towards x = 0), if possible
- Makes the bot face in the
'left'
direction
- Moves the bot right (away from x = 0), if possible
- Makes the bot face in the
'right'
direction
- Skips the current turn
Calling any of these methods does not use a turn.
- Parameter
direction
:string
the direction in which to face ('up'
,'down'
,'left'
, or'right'
)
- Returns:
boolean
True
if the bot cannot move in the direction it is currently facing,False
otherwise
Calling any of these methods does not use a turn.
- Returns:
int
the width of the playing field
- Returns:
int
the height of the playing field
- Returns:
int
the turn number, starting from zero
- Returns:
int
the maximum number of turns in the game
- Returns:
bool
True
if the game is not over,False
otherwise
- Returns:
int
the number of players in the game
- Returns:
int
the number of cells currently in your color
- Parameter
pid
:int
player id - Returns:
int
the number of cells currently in the color of the player with the given id
- Returns:
list
a list of two integers representing your current x and y position on the playing field
- Parameter
pid
:int
player id - Returns:
list
a list of two integers representing the current x and y position on the playing field of the player with the given id
- Returns:
int
a number representing your color
- Parameter
x
:int
the x coordinate of a cell - Parameter
y
:int
the y coordinate of a cell - Returns:
int
a number representing the color of the cell at the given coordinates
- Parameter
x
:int
the x coordinate of a cell - Parameter
y
:int
the y coordinate of a cell - Returns:
bool
True
if there is an occupied cell at the given coordinates,False
otherwise
- Parameter
x
:int
the x coordinate of a cell - Parameter
y
:int
the y coordinate of a cell - Returns:
bool
True
if there is a cell at the given coordinates within the playing field,False
otherwise