#include <vector>
#include <deque>

using namespace std;
const int BOARD_SIZE = 10;
const int INITIAL_BOTLETS = 8;
const int NUM_TICKS = 100;

// Position is a simple struct that contains an x or y.
struct Position{
    int x;
    int y;
};

// This is what operation queues will contain.
// for what mode means: refer to the slides for diagrams. 
// In summary:

// mode = 0:
// Match x coordinate, then y coordinate

// mode = 1:
// Match y coordinate, then x coordinate

// mode = 2:
// Wander randomly towards destination (but still in minimal possible time)

struct Operation{
    Position position;
    int mode;
};

// Called at the very start. Use it to initialise whatever data structures you so please
void init();

// Called every single tick
void tick(
    // Board is 0 indexed, board[x][y] gets the state of the cell (x,y)
    // 0 means unpainted, 1 means painted your colour, and 2 means painted the enemy colour.
    vector<vector<int>> board, 

    // A vector of the positions of your botlets: player_botlets[i] is the location of botlet i
    vector<Position> player_botlets, 

    // A vector of the operation queues of each of your botlets: operation_queues[i] is current operation queue of botlet i.
    vector<deque<Operation>> operation_queues, 

    // A vector of the positions of the enemy botlets: enemy_botlets[i] is the location of the ith botlet
    vector<Position> enemy_botlets, 

    // The current tick. The first tick will be tick 1, which is when you and your opponent will decide your first move.
    // On the last tick, (the 100th tick), you and your opponent will decide your last move.
    // The game will only be simulated between calls to tick().
    int current_tick, 
    
    // The amount of time you have left to compute, in seconds.
    double remaining_compute_time
);


// This enqueues a move operation:
// botlet: the botlet to move
// position: the position to move to (see above for what Position means)
// mode: Only matters for move operations where you instruct bots to move to non-adjacent cells
// See above for what each of the 3 modes means
void move(int botlet, Position position, int mode);

// cancels all operations from the operation queue of the desired botlet.
void cancel_all_operations(int botlet);
