Skip to content

Commit e9b9c84

Browse files
committed
Prevent empty cells from mirror.
1 parent 093cc0e commit e9b9c84

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

lib/src/coloring/basic_coloring.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ class BasicColoring {
436436
bool mirrorVerticalLeftRight() {
437437
for (final int i in 0.rangeTo(2)) {
438438
for (final int j in 0.rangeTo(5)) {
439-
if(_shape.grid[i][j] != 0) {
439+
if(_shape.grid[j][i] != 0) {
440440
_shape.grid[j][5 - i] = _shape.grid[j][i];
441441
}
442442
}
@@ -453,7 +453,7 @@ class BasicColoring {
453453
bool mirrorVerticalRightLeft() {
454454
for (final int i in 3.rangeTo(5)) {
455455
for (final int j in 0.rangeTo(5)) {
456-
if(_shape.grid[i][j] != 0) {
456+
if(_shape.grid[j][i] != 0) {
457457
_shape.grid[j][5 - i] = _shape.grid[j][i];
458458
}
459459
}

test/interpreter_test.dart

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -449,11 +449,12 @@ void other_schemas() {
449449
[0, 0, 0, 0, 0, 0],
450450
[0, 0, 0, 0, 0, 0],
451451
]));
452+
var results =interpreter
453+
.validateOnScheme(
454+
"GO(up) PAINT({yellow}), GO(right), PAINT({red}), GO(right), PAINT({blue}, 3, up), MIRROR(horizontal), MIRROR(vertical)",
455+
1);
452456
expect(
453-
interpreter
454-
.validateOnScheme(
455-
"GO(up) PAINT({yellow}), GO(right), PAINT({red}), GO(right), PAINT({blue}, 3, up), MIRROR(horizontal) MIRROR(vertical)",
456-
1)
457+
results
457458
.first
458459
.completed,
459460
isTrue);

0 commit comments

Comments
 (0)