From fedfbb3dbc2b849884cbf23145bd4dae464a7345 Mon Sep 17 00:00:00 2001 From: Andrei Stoica Date: Sun, 29 Dec 2024 23:56:42 -0500 Subject: [PATCH] game validation logic bugfix --- lib/util.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/util.dart b/lib/util.dart index b0f9fff..edaf5e1 100644 --- a/lib/util.dart +++ b/lib/util.dart @@ -30,7 +30,7 @@ class Util { "${index % 3}, ${(index / 3).floor()}"; static Iterable getRow(int index, List data) => - data.getRange(index, index + 3); + data.getRange(index * 3, index * 3 + 3); static Iterable getCol(int index, List 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 row) =>