game validation logic bugfix

This commit is contained in:
Andrei Stoica 2024-12-29 23:56:42 -05:00
parent ef96a6623e
commit fedfbb3dbc
1 changed files with 2 additions and 2 deletions

View File

@ -30,7 +30,7 @@ class Util {
"${index % 3}, ${(index / 3).floor()}";
static Iterable<TTCState> getRow(int index, List<TTCState> data) =>
data.getRange(index, index + 3);
data.getRange(index * 3, index * 3 + 3);
static Iterable<TTCState> getCol(int index, List<TTCState> data) => [
data[index],
data[index + 3],
@ -40,7 +40,7 @@ class Util {
if (index == 0) {
return [data[0], data[4], data[8]];
}
return [data[3], data[4], data[6]];
return [data[2], data[4], data[6]];
}
static TTCState checkRow(Iterable<TTCState> row) =>