game validation logic bugfix
This commit is contained in:
parent
ef96a6623e
commit
fedfbb3dbc
|
|
@ -30,7 +30,7 @@ class Util {
|
||||||
"${index % 3}, ${(index / 3).floor()}";
|
"${index % 3}, ${(index / 3).floor()}";
|
||||||
|
|
||||||
static Iterable<TTCState> getRow(int index, List<TTCState> data) =>
|
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) => [
|
static Iterable<TTCState> getCol(int index, List<TTCState> data) => [
|
||||||
data[index],
|
data[index],
|
||||||
data[index + 3],
|
data[index + 3],
|
||||||
|
|
@ -40,7 +40,7 @@ class Util {
|
||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
return [data[0], data[4], data[8]];
|
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) =>
|
static TTCState checkRow(Iterable<TTCState> row) =>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue