squareLeftUpRight method
Color with a square shape from the current position.
Requires a list of colors
.
Implementation
bool squareLeftUpRight(List<int> colors, [int? n]) {
final int originalRow = move.row;
final int originalColumn = move.column;
if (move.left(1, false) && move.up(1, false) && move.right(1, false)) {
move.toPosition(originalRow, originalColumn);
color(colors[0 % colors.length]);
move.left();
color(colors[1 % colors.length]);
move.up();
color(colors[2 % colors.length]);
move.right();
color(colors[3 % colors.length]);
return true;
}
move.toPosition(originalRow, originalColumn);
return false;
}