#include "robot.h"
/*
boundary: state = -2
obstacle: state = -1
otherwise: state = colour
n = up, s = down, w = left, e = right
S[0] is the state of cell (r, c).
S[1] is the state of the cell to the west.
S[2] is the state of the cell to the south.
S[3] is the state of the cell to the east.
S[4] is the state of the cell to the north.
*/
void program_pulibot() {
// if its entirely empty: go right while not a border on the right, then go up
// if
set_instruction({0, -2, 0, 0, -2}, 1, 'E'); // at (0, 0): go right
set_instruction({0, 1, 0, 0, -2}, 1, 'E'); // travelling along bottom: go right
set_instruction({0, 1, 0, -2, -2}, 1, 'S'); // at (W, 0): go down
set_instruction({0, 0, 0, -2, 1}, 1, 'S'); // travelling along side: go down
set_instruction({0, 0, -2, -2, 1}, 1, 'T'); // at (W, H): terminate
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |