Skip to content
Snippets Groups Projects
Commit 698e79cb authored by Benoît Harrault's avatar Benoît Harrault
Browse files

Fix "fixed cells state" when randomize board

parent 739fbb9c
No related branches found
No related tags found
1 merge request!13Resolve "Fix cells fixed state when randomize board"
Pipeline #1403 passed
org.gradle.jvmargs=-Xmx1536M org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true android.useAndroidX=true
android.enableJetifier=true android.enableJetifier=true
app.versionName=0.0.11 app.versionName=0.0.12
app.versionCode=11 app.versionCode=12
...@@ -7,7 +7,7 @@ class Cell { ...@@ -7,7 +7,7 @@ class Cell {
int value; int value;
final int col; final int col;
final int row; final int row;
final bool isFixed; bool isFixed;
Cell( Cell(
@required this.value, @required this.value,
......
...@@ -123,6 +123,13 @@ class Home extends StatelessWidget { ...@@ -123,6 +123,13 @@ class Home extends StatelessWidget {
break; break;
} }
// Fix cells fixed states
for (var rowIndex = 0; rowIndex < sideLength; rowIndex++) {
for (var colIndex = 0; colIndex < sideLength; colIndex++) {
cells[rowIndex][colIndex].isFixed = (cells[rowIndex][colIndex].value != 0) ? true : false;
}
}
return cells; return cells;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment